Browse Source

improve copy process

Karsten Böddeker 6 years ago
parent
commit
8de38fd686
1 changed files with 7 additions and 6 deletions
  1. 7 6
      build.sh

+ 7 - 6
build.sh

@@ -267,16 +267,17 @@ popd > /dev/null #${CODE_DIR}
 if [ "${PUBLISH}" -eq "1" ]; then
 	# copying firmware to the server
 	if [ -d "${IMAGE_DIR}" ]; then
-		progress "Copying the firmware ..."
-		rsync -rlutzc --exclude=*manifest -e ssh ${IMAGE_DIR}/ ${SRV_USER}@${SRV_URL}:${SRV_PATH}/${VERSION}
-		[ "$?" -eq "0" ] || abort "Failed to copy the firmware."
+		progress "Copying firmware images ..."
+		rsync -rlutzc  --filter="+ */" --filter="+ *-${VERSION}-*" --filter="- *" -e ssh ${IMAGE_DIR}/ ${SRV_USER}@${SRV_URL}:${SRV_PATH}/${VERSION}
+		[ "$?" -eq "0" ] || abort "Failed to copy firmware images."
 	fi
 
 	# copying modules to the server
 	if [ -d "${MODULE_DIR}" ]; then
-		progress "Copying the modules ..."
-		rsync -rlutzc -e ssh ${MODULE_DIR}/gluon-ffho-${VERSION}/ ${SRV_USER}@${SRV_URL}:${SRV_PATH}/${VERSION}/modules
-		[ "$?" -eq "0" ] || abort "Failed to copy the modules."
+		progress "Copying modules ..."
+		MODULE_DIR=$(find ${MODULE_DIR}/ -maxdepth 1 -name *${VERSION})
+		rsync -rlutzc -e ssh ${MODULE_DIR}/ ${SRV_USER}@${SRV_URL}:${SRV_PATH}/${VERSION}/modules
+		[ "$?" -eq "0" ] || abort "Failed to copy modules."
 	fi
 
 	# copy manifest and the build info file