From a459b6411b8ec04b640a55a76069399a488cd1ed Mon Sep 17 00:00:00 2001 From: Josh Deprez Date: Wed, 4 Dec 2024 16:33:06 +1100 Subject: [PATCH] Fix S3 upload for non-tagged builds Co-authored-by: James Healy --- .buildkite/steps/upload-to-s3.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.buildkite/steps/upload-to-s3.sh b/.buildkite/steps/upload-to-s3.sh index d56797a..c449dfd 100755 --- a/.buildkite/steps/upload-to-s3.sh +++ b/.buildkite/steps/upload-to-s3.sh @@ -38,10 +38,13 @@ fi echo "~~~ :buildkite: Downloading artifacts" -artifacts_build="$(buildkite-agent meta-data get "metrics-artifacts-build")" - mkdir -p dist -buildkite-agent artifact download --build "${artifacts_build}" dist/handler.zip ./dist +if [[ "${1:-}" == "release" ]] ; then + artifacts_build="$(buildkite-agent meta-data get "metrics-artifacts-build")" + buildkite-agent artifact download --build "${artifacts_build}" dist/handler.zip ./dist +else + buildkite-agent artifact download dist/handler.zip ./dist +fi echo "--- :s3: Uploading lambda to ${BASE_BUCKET}/${BUCKET_PATH}/ in ${AWS_DEFAULT_REGION}" aws s3 cp --acl public-read dist/handler.zip "s3://${BASE_BUCKET}/${BUCKET_PATH}/handler.zip"