Skip to content

Commit

Permalink
keep file in build directory
Browse files Browse the repository at this point in the history
  • Loading branch information
stebo85 committed Jun 22, 2024
1 parent f793b53 commit bd2e600
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
14 changes: 6 additions & 8 deletions .github/workflows/upload-zip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@ echo "[DEBUG] recipes/$APPLICATION"
cd recipes/$APPLICATION

IMAGENAME=$1
IMAGE_HOME=/storage/openrecon

echo "[DEBUG] IMAGE_HOME: $IMAGE_HOME"
echo "[DEBUG] IMAGENAME: $IMAGENAME"

ls -la $IMAGE_HOME/$IMAGENAME.zip
ls -la $IMAGENAME.zip


#This prevents the sometimes stuck apt process from stopping the build
Expand All @@ -21,16 +19,16 @@ if [ -f "/var/lib/apt/lists/lock" ]; then
fi

echo "[DEBUG] Attempting upload to AWS Object Storage ..."
rclone copy --progress $IMAGE_HOME/${IMAGENAME}.zip aws-neurocontainers:/openrecon
rclone copy --progress ${IMAGENAME}.zip aws-neurocontainers:/openrecon

if curl --output /dev/null --silent --head --fail "https://openrecon.neurodeks.org/${IMAGENAME}.zip"; then
echo "[DEBUG] ${IMAGENAME}.simg was freshly build and exists now :)"
echo "[DEBUG] cleaning up $IMAGE_HOME/${IMAGENAME}.zip"
rm -rf $IMAGE_HOME/${IMAGENAME}.zip
echo "[DEBUG] cleaning up ${IMAGENAME}.zip"
rm -rf ${IMAGENAME}.zip
else
echo "[ERROR] ${IMAGENAME}.zip does not exist yet. Something is WRONG"
echo "[ERROR] cleaning up $IMAGE_HOME/${IMAGENAME}.zip"
rm -rf $IMAGE_HOME/${IMAGENAME}.zip
echo "[ERROR] cleaning up ${IMAGENAME}.zip"
rm -rf ${IMAGENAME}.zip
exit 2
fi

6 changes: 3 additions & 3 deletions recipes/defacing/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@ def validateJson(jsonFilePath, schemaFilePath):
output = subprocess.check_output([zipExe, 'a', '-tzip', '-mm=Deflate', baseFilename + '.zip', baseFilename + '.tar', baseFilename + '.pdf'], stderr=subprocess.STDOUT)
print('Zip packaging output:\n' + output.decode('utf-8'))

print('Moving file to archive storage:', baseFilename + '.zip', '...')
output = subprocess.check_output(['mv', baseFilename + '.zip', '/storage/openrecon/' + baseFilename + '.zip'], stderr=subprocess.STDOUT)
print('moved file to /storage/openrecon')
# print('Moving file to archive storage:', baseFilename + '.zip', '...')
# output = subprocess.check_output(['mv', baseFilename + '.zip', '/storage/openrecon/' + baseFilename + '.zip'], stderr=subprocess.STDOUT)
# print('moved file to /storage/openrecon')



Expand Down

0 comments on commit bd2e600

Please sign in to comment.