-
Notifications
You must be signed in to change notification settings - Fork 1
/
deploy.sh
executable file
·24 lines (24 loc) · 934 Bytes
/
deploy.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash
if [ $1 = "data_viz_project_template" ]; then
echo "You need to specify your project name in package.json $1"
exit 1
else
echo "Your project directory: $1"
fi
for file in ./public/*
do
if [[ $file = *bundle.*.js ]]; then
rm "./public/bundle.js"
mv $file "./public/bundle.js"
aws s3 cp "./public/bundle.js" s3://datadotnewamerica/$1/bundle.js
elif [[ $file = *bundle.*.js.gz ]]; then
mkdir ./public/archive ./public/dist
cp $file ./public/archive/
aws s3 cp $file s3://datadotnewamerica/$1/archive/ --content-type "text/javascript" --content-encoding "gzip"
rm "./public/dist/bundle.js.gz"
mv $file ./public/dist/bundle.js.gz
aws s3 cp ./public/dist/bundle.js.gz s3://datadotnewamerica/$1/dist/bundle.js.gz --content-type "text/javascript" --content-encoding "gzip"
elif [[ $file = *index.html* ]]; then
aws s3 cp $file s3://datadotnewamerica/$1/index.html
fi
done