Skip to content

Commit

Permalink
ci: allow overwrite for 'latest' version
Browse files Browse the repository at this point in the history
We don't want to allow explicitly versioned binaries to be overwritten, but we do need to
accommodate this for the 'latest' version.
  • Loading branch information
jacderida committed Jul 5, 2024
1 parent efd5ee9 commit 0ae7c0f
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -379,12 +379,18 @@ upload-release-assets-to-s3 bin_name:
cd deploy/{{bin_name}}
for file in *.zip *.tar.gz; do
dest="s3://$bucket/$file"
if aws s3 ls "$dest" > /dev/null 2>&1; then
echo "$dest already exists. This suggests an error somewhere."
echo "If you intentionally want to overwrite, remove the file and run the workflow again."
exit 1
else
if [[ "$file" == *latest* ]]; then
echo "Allowing overwrite for 'latest' version..."
aws s3 cp "$file" "$dest" --acl public-read
else
if aws s3 ls "$dest" > /dev/null 2>&1; then
echo "$dest already exists. This suggests an error somewhere."
echo "If you intentionally want to overwrite, remove the file and run the workflow again."
exit 1
else
aws s3 cp "$file" "$dest" --acl public-read
echo "$dest uploaded."
fi
fi
done

Expand Down

0 comments on commit 0ae7c0f

Please sign in to comment.