-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·28 lines (23 loc) · 886 Bytes
/
deploy.sh
File metadata and controls
executable file
·28 lines (23 loc) · 886 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash
target=$1
# build vue app
if [ "$target" == "stage" ]; then
echo "** Building stage **"
npm run build
elif [ "$target" ]; then
echo "** Building prod **"
#NODE_ENV=production npm run build
npm run build
fi
# upload to cloudfront
if [ "$target" == "stage" ]; then
echo "** Uploading to stage s3 bucket **"
aws s3 cp ./client s3://static.iobio.io/stage/bam.iobio.io/stage/ --recursive --cache-control 'public, max-age=86400'
echo "** Renew cloudfrount cache **"
aws cloudfront create-invalidation --distribution-id EW1T1HDKHSTBF --paths /\*
elif [ "$target" ]; then
echo "** Uploading to prod s3 bucket **"
aws s3 cp ./client s3://static.iobio.io/prod/bam.iobio.io/$target/ --recursive --cache-control 'public, max-age=86400'
echo "** Renew cloudfrount cache **"
aws cloudfront create-invalidation --distribution-id E1SI8J5TK5FF8 --paths /\*
fi