2024-08-08 21:49:56 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2024-08-01 06:25:44 +02:00
|
|
|
# Downloads the artifacts for the specified version from the staging bucket for local testing.
|
2024-08-16 20:53:43 +02:00
|
|
|
# Usage: download-staged-artifact.sh <version> <aws-profile>
|
|
|
|
# Example: download-staged-artifact.sh 0.1.0 storage
|
2024-08-08 21:49:56 +02:00
|
|
|
|
2024-08-01 06:25:44 +02:00
|
|
|
VERSION=$1
|
2024-08-16 20:53:43 +02:00
|
|
|
AWS_PROFILE=$2
|
2024-08-16 22:22:54 +02:00
|
|
|
if [ -z "$VERSION" ] || [ -z "$AWS_PROFILE" ]; then
|
2024-08-16 20:53:43 +02:00
|
|
|
echo "Usage: $0 <version> <aws-profile>"
|
2024-08-01 06:25:44 +02:00
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
2024-08-08 21:49:56 +02:00
|
|
|
# Gets the directory of the script
|
|
|
|
SCRIPT_DIR=$(dirname $0)
|
|
|
|
|
2024-08-01 06:25:44 +02:00
|
|
|
# Download the artifacts for the specified version from the staging bucket
|
2024-08-08 21:49:56 +02:00
|
|
|
DOWNLOAD_DIR=$SCRIPT_DIR/$VERSION-staged
|
2024-08-01 06:25:44 +02:00
|
|
|
rm -rf $DOWNLOAD_DIR
|
|
|
|
mkdir -p $DOWNLOAD_DIR
|
|
|
|
aws s3 cp s3://waveterm-github-artifacts/staging-w2/$VERSION/ $DOWNLOAD_DIR/ --recursive --profile $AWS_PROFILE
|