-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.sh
40 lines (29 loc) · 1.15 KB
/
build.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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
npm run build
mkdir -p /home/engagebay/Documents/workspace/engagebay-maven/src/main/webapp/proposals/js
mkdir -p /home/engagebay/Documents/workspace/engagebay-maven/src/main/webapp/proposals/css
cd dist/
cp -r main.js /home/engagebay/Documents/workspace/engagebay-maven/src/main/webapp/proposals/js/main.js
cp -r main.*.js.map /home/engagebay/Documents/workspace/engagebay-maven/src/main/webapp/proposal/js/main.js.map
# cd dist/
# cp -r main.*.css $ENGAGEBAY_FOLDER_PATH/src/main/webapp/proposal/css/main.css
# CDN MAPPING
if [ "$1" ]; then
echo $1
# /bin/bash theme.sh
mkdir -p $1
rm -r $1/*
cp -r dist/* $1/
mv $1/js/main.*.js $1/js/main.js
mv $1/js/main.*.js.map $1/js/main.js.map
mv $1/css/main.*.css $1/css/main.css
## Make the ZIP
zip -r $1.zip $1
## Send to CDN
scp -i $EC2_PERMISSIONS $1.zip [email protected]:~/proposals/
ssh -i $EC2_PERMISSIONS [email protected] "unzip -o proposals/$1 -d proposals/ && rm -r proposals/$1.zip"
echo "Updated CDN version : $1"
rm -r $1
rm -r $1.zip
else
echo "No CDN2"
fi