mirror of
https://github.com/trezor/trezor-wallet
synced 2025-02-05 12:51:44 +00:00
update Makefile and s3sync scripts
This commit is contained in:
parent
3636142911
commit
efc82b90c1
27
Makefile
27
Makefile
@ -1,5 +1,28 @@
|
|||||||
|
# Run docker build
|
||||||
|
# usage:
|
||||||
|
# make build-beta
|
||||||
|
# make build-stable
|
||||||
build-%:
|
build-%:
|
||||||
./scripts/docker-build.sh $*
|
./scripts/docker-build.sh $*
|
||||||
|
|
||||||
sync-%:
|
# s3sync with stage.mytrezor.com
|
||||||
./scripts/s3sync.sh $*
|
# Upload requested build for testing purposes
|
||||||
|
# usage:
|
||||||
|
# make stage-beta
|
||||||
|
# make stage-stable
|
||||||
|
stage-%:
|
||||||
|
./scripts/s3sync.sh stage $*
|
||||||
|
|
||||||
|
# s3sync with beta.mytrezor.com
|
||||||
|
# Upload build/beta only
|
||||||
|
# usage:
|
||||||
|
# make beta
|
||||||
|
beta:
|
||||||
|
./scripts/s3sync.sh beta beta
|
||||||
|
|
||||||
|
# s3sync with wallet.mytrezor.com
|
||||||
|
# Upload build/stable only
|
||||||
|
# usage:
|
||||||
|
# make stable
|
||||||
|
stable:
|
||||||
|
./scripts/s3sync.sh stable stable
|
60
scripts/s3sync.sh
Normal file → Executable file
60
scripts/s3sync.sh
Normal file → Executable file
@ -13,41 +13,63 @@ function confirm {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
if [ "x$1" == "x" ]; then
|
|
||||||
echo "./s3sync.sh stage|beta|wallet [-d]"
|
# Validate params
|
||||||
|
if [ "x$1" == "x" ] || [ "x$2" == "x" ]; then
|
||||||
|
echo "Invalid params"
|
||||||
|
echo "./s3sync.sh beta|stable stage|beta|stable [clear]"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Validate destination param
|
||||||
|
if [ "x$1" != "xstage" ] && [ "x$1" != "xbeta" ] && [ "x$1" != "xstable" ]; then
|
||||||
|
echo "Invalid destination: "$1
|
||||||
|
echo "use: stage|beta|stable"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Validate source param
|
||||||
|
if [ "x$2" != "xbeta" ] && [ "x$2" != "xstable" ]; then
|
||||||
|
echo "Invalid source: "$2
|
||||||
|
echo "use: beta|stable"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Set source directory
|
||||||
|
if [ "x$2" == "xbeta" ]; then
|
||||||
|
SOURCE=../build/beta
|
||||||
|
|
||||||
|
elif [ "x$2" == "xstable" ]; then
|
||||||
|
SOURCE=../build/stable
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Set destination
|
||||||
if [ "x$1" == "xstage" ]; then
|
if [ "x$1" == "xstage" ]; then
|
||||||
DIST=../build/beta
|
|
||||||
BUCKET=stage.mytrezor.com
|
BUCKET=stage.mytrezor.com
|
||||||
DISTRIBUTION_ID="E24M0QWO692FQL"
|
DISTRIBUTION_ID="E24M0QWO692FQL"
|
||||||
|
|
||||||
elif [ "x$1" == "xbeta" ]; then
|
elif [ "x$1" == "xbeta" ]; then
|
||||||
DIST=../build/beta
|
|
||||||
BUCKET=beta.mytrezor.com
|
BUCKET=beta.mytrezor.com
|
||||||
DISTRIBUTION_ID="E1PONNHWUNCQ9M"
|
DISTRIBUTION_ID="E1PONNHWUNCQ9M"
|
||||||
|
elif [ "x$2" == "xstable" ]; then
|
||||||
confirm
|
|
||||||
|
|
||||||
elif [ "x$1" == "xwallet" ]; then
|
|
||||||
DIST=../build/prod
|
|
||||||
BUCKET=wallet.mytrezor.com
|
BUCKET=wallet.mytrezor.com
|
||||||
DISTRIBUTION_ID="EZM01GFTITGVD"
|
DISTRIBUTION_ID="EZM01GFTITGVD"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "sync "$SOURCE" with "$BUCKET"/next"
|
||||||
|
|
||||||
|
if [ "x$1" == "xbeta" ] || [ "x$1" == "xstable" ]; then
|
||||||
confirm
|
confirm
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
set -e
|
# set -e
|
||||||
cd `dirname $0`
|
# cd `dirname $0`
|
||||||
|
|
||||||
if [ "x$2" == "x-d" ]; then
|
# if [ "x$3" == "x-d" ]; then
|
||||||
aws s3 sync --delete --cache-control 'public, max-age=3600' $DIST s3://$BUCKET/next
|
# aws s3 sync --delete --cache-control 'public, max-age=3600' $SOURCE s3://$BUCKET/next
|
||||||
else
|
# else
|
||||||
aws s3 sync --cache-control 'public, max-age=3600' $DIST s3://$BUCKET/next
|
# aws s3 sync --cache-control 'public, max-age=3600' $SOURCE s3://$BUCKET/next
|
||||||
fi
|
# fi
|
||||||
|
|
||||||
aws cloudfront create-invalidation --distribution-id $DISTRIBUTION_ID --paths '/*'
|
# aws cloudfront create-invalidation --distribution-id $DISTRIBUTION_ID --paths '/next/*'
|
||||||
|
|
||||||
echo "DONE"
|
echo "DONE"
|
Loading…
Reference in New Issue
Block a user