Skip to content

Commit

Permalink
fix: publish to latest in S3 (#4619)
Browse files Browse the repository at this point in the history
  • Loading branch information
j-luong authored May 25, 2023
1 parent 949abc2 commit b6d2aab
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions release-scripts/upload-artifacts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -92,27 +92,28 @@ upload_npm() {
}

upload_s3() {
version_target=$1
if [ "${DRY_RUN}" == true ]; then
echo "DRY RUN: uploading to S3..."
for filename in "${StaticFiles[@]}"; do
aws s3 cp "${filename}" s3://"${PUBLIC_S3_BUCKET}"/cli/"${VERSION_TAG}"/ --dryrun
aws s3 cp "${filename}" s3://"${PUBLIC_S3_BUCKET}"/cli/"${version_target}"/ --dryrun
done

aws s3 cp "binary-releases/release.json" s3://"${PUBLIC_S3_BUCKET}"/cli/"${VERSION_TAG}"/ --dryrun
aws s3 cp "binary-releases/version" s3://"${PUBLIC_S3_BUCKET}"/cli/"${VERSION_TAG}"/ --dryrun
aws s3 cp "binary-releases/release.json" s3://"${PUBLIC_S3_BUCKET}"/cli/"${version_target}"/ --dryrun
aws s3 cp "binary-releases/version" s3://"${PUBLIC_S3_BUCKET}"/cli/"${version_target}"/ --dryrun
else
echo "Uploading to S3..."
for filename in "${StaticFiles[@]}"; do
aws s3 cp "${filename}" s3://"${PUBLIC_S3_BUCKET}"/cli/"${VERSION_TAG}"/
aws s3 cp "${filename}" s3://"${PUBLIC_S3_BUCKET}"/cli/"${version_target}"/
done

aws s3 cp "binary-releases/release.json" s3://"${PUBLIC_S3_BUCKET}"/cli/"${VERSION_TAG}"/
aws s3 cp "binary-releases/version" s3://"${PUBLIC_S3_BUCKET}"/cli/"${VERSION_TAG}"/
aws s3 cp "binary-releases/release.json" s3://"${PUBLIC_S3_BUCKET}"/cli/"${version_target}"/
aws s3 cp "binary-releases/version" s3://"${PUBLIC_S3_BUCKET}"/cli/"${version_target}"/
fi
}

# Capture valid flags
while getopts ":h:t:-:" opt; do
while getopts ":h:-:" opt; do
case ${opt} in
h)
show_help
Expand Down Expand Up @@ -160,6 +161,6 @@ for arg in "${@}"; do

# Upload files to S3 bucket
else
upload_s3
upload_s3 "${target}"
fi
done

0 comments on commit b6d2aab

Please sign in to comment.