Skip to content

Commit

Permalink
Make repository_uploader to support S3_FILES_TO_UPLOAD
Browse files Browse the repository at this point in the history
Signed-off-by: Jose Luis Rivero <[email protected]>
  • Loading branch information
j-rivero committed Sep 7, 2023
1 parent 78cfa9e commit 0386de1
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions jenkins-scripts/lib/repository_uploader.bash
Original file line number Diff line number Diff line change
Expand Up @@ -131,16 +131,20 @@ case ${UPLOAD_TO_REPO} in
;;
esac

# .zip | (mostly) windows packages
for pkg in `ls $pkgs_path/*.zip`; do

# S3_FILES_TO_UPLOAD can contain a list of filenames relative to $pkgs_path that will be uploaded to S3
# together with any .zip (mostly old windows packages) if they exists
S3_FILES_TO_UPLOAD="${S3_FILES_TO_UPLOAD} $(find "$pkgs_path" -type f -name '*.zip' -printf '%f\n' || true)"

for pkg in ${S3_FILES_TO_UPLOAD}; do
# S3_UPLOAD_PATH should be send by the upstream job
if [[ -z ${S3_UPLOAD_PATH} ]]; then
echo "S3_UPLOAD_PATH was not defined. Not uploading"
exit 1
fi

# Seems important to upload the path with a final slash
S3_upload ${pkg} "${S3_UPLOAD_PATH}"
S3_upload "${pkgs_path}/${pkg}" "${S3_UPLOAD_PATH}"
done

# .bottle | brew binaries
Expand Down

0 comments on commit 0386de1

Please sign in to comment.