Skip to content

Commit

Permalink
Update preBuildHook.s3
Browse files Browse the repository at this point in the history
  • Loading branch information
angerman committed May 9, 2024
1 parent 5127cb0 commit 8f82a21
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cabalHooks/preBuildHook.s3
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
CACHE_KEY="$1.tar.gz"

# Check if artifact exists in S3 (with endpoint and credentials)
aws s3 ls s3://"$CACHE_BUCKET"/"$CACHE_KEY" --endpoint-url "$AWS_ENDPOINT" > /dev/null 2>&1
aws s3 ls s3://"$CACHE_BUCKET"/devx-shell/"$CACHE_KEY" --endpoint-url "$AWS_ENDPOINT" > /dev/null 2>&1

# shellcheck disable=SC2181
if [ $? -eq 0 ]; then
echo "S3 hit $1"
aws s3 cp s3://"$CACHE_BUCKET"/"$CACHE_KEY" - --endpoint-url "$AWS_ENDPOINT" | tar -xz
aws s3 cp s3://"$CACHE_BUCKET"/devx-shell/"$CACHE_KEY" - --endpoint-url "$AWS_ENDPOINT" | tar -xz
else
echo "S3 miss $1"
exit 1
Expand Down

0 comments on commit 8f82a21

Please sign in to comment.