Skip to content

Commit

Permalink
Update postBuildHook.s3
Browse files Browse the repository at this point in the history
  • Loading branch information
angerman committed May 9, 2024
1 parent d17176b commit 5127cb0
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions cabalHooks/postBuildHook.s3
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#!/usr/bin/env bash

# shellcheck disable=SC1091,SC2046
. "$(dirname "${BASH_SOURCE[0]}")/s3-credentials.bash"

CACHE_KEY="$1.tar.gz"

echo "Compressing and uploading $1 to S3"
tar -czf $CACHE_KEY --exclude=$3/setup-config $3
aws s3 cp $CACHE_KEY s3://$CACHE_BUCKET/devx-shell/$CACHE_KEY --endpoint-url $AWS_ENDPOINT
rm $CACHE_KEY # Optional: Cleanup local file
echo "S3 upload $1"
tar -czf "$CACHE_KEY" --exclude="$3/setup-config" "$3"
aws s3 cp "$CACHE_KEY" s3://"$CACHE_BUCKET"/devx-shell/"$CACHE_KEY" --endpoint-url "$AWS_ENDPOINT"
rm "$CACHE_KEY" # Optional: Cleanup local file

0 comments on commit 5127cb0

Please sign in to comment.