-
Notifications
You must be signed in to change notification settings - Fork 721
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
63 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env bash | ||
|
||
#./postBuildHook.local "$@" | ||
postBuildHook.s3 "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env bash | ||
|
||
CACHE=$HOME/.cabal-build-cache | ||
|
||
mkdir -p $CACHE | ||
|
||
echo "Uploading $1 to $CACHE" | ||
tar -czf $CACHE/$1.tar.gz --exclude=$3/setup-config $3 | ||
exit 0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env bash | ||
|
||
. "$(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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env bash | ||
|
||
#./preBuildHook.local "$@" | ||
preBuildHook.s3 "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/usr/bin/env bash | ||
|
||
CACHE=$HOME/.cabal-build-cache | ||
|
||
mkdir -p $CACHE | ||
|
||
if [ -f $CACHE/$1.tar.gz ]; then | ||
echo "Cache hit" | ||
tar -xzf $CACHE/$1.tar.gz | ||
exit 0 | ||
else | ||
echo "Cache miss" | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/usr/bin/env bash | ||
|
||
. "$(dirname "${BASH_SOURCE[0]}")/s3-credentials.bash" | ||
|
||
CACHE_KEY="$1.tar.gz" | ||
|
||
# Check if artifact exists in S3 (with endpoint and credentials) | ||
aws s3 ls s3://$CACHE_BUCKET/devx-shell/$CACHE_KEY --endpoint-url $AWS_ENDPOINT > /dev/null 2>&1 | ||
|
||
if [ $? -eq 0 ]; then | ||
echo "Cache hit - downloading from S3" | ||
aws s3 cp s3://$CACHE_BUCKET/devx-shell/$CACHE_KEY - --endpoint-url $AWS_ENDPOINT | tar -xz | ||
else | ||
echo "Cache miss" | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
CACHE_BUCKET="cabal-cache" # Replace with your bucket name | ||
export AWS_ACCESS_KEY_ID=$CABAL_AWS_ACCESS_KEY_ID | ||
export AWS_SECRET_ACCESS_KEY=$CABAL_AWS_SECRET_ACCESS_KEY | ||
export AWS_DEFAULT_REGION=auto | ||
AWS_ENDPOINT="https://c1fe99e5a421ac98af478e51dda5db4f.r2.cloudflarestorage.com" |