From 0386de18957ba2b2ec0b59df9d85e64a26601837 Mon Sep 17 00:00:00 2001 From: Jose Luis Rivero Date: Thu, 7 Sep 2023 19:44:31 +0200 Subject: [PATCH] Make repository_uploader to support S3_FILES_TO_UPLOAD Signed-off-by: Jose Luis Rivero --- jenkins-scripts/lib/repository_uploader.bash | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/jenkins-scripts/lib/repository_uploader.bash b/jenkins-scripts/lib/repository_uploader.bash index 2b15375b5..79e01c224 100644 --- a/jenkins-scripts/lib/repository_uploader.bash +++ b/jenkins-scripts/lib/repository_uploader.bash @@ -131,8 +131,12 @@ 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" @@ -140,7 +144,7 @@ for pkg in `ls $pkgs_path/*.zip`; do 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