Skip to content

Commit 37f6c49

Browse files
committed
Add backup before deploy
1 parent 8e8768b commit 37f6c49

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

deploy-prod.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@ if [[ ! $b4a_certs_path ]]; then echo 'Set b4a_certs_path environment variable,
55
host=52.0.232.94
66
user=ubuntu
77
pem=Back4App_Production.pem
8+
now=`date '+%Y%m%d%H%M%S'`
89

910
branch=master
1011
git='~/bin/git-parse-dashboard'
11-
ssh -t -i $b4a_certs_path/$pem $user@$host "sudo su back4app -c '. ~/.nvm/nvm.sh && nvm use 9 && cd ~/scm/parse-dashboard && $git reset --hard && $git remote update && $git checkout $branch && $git merge origin/$branch && yarn install --production=false && npm run prepublish && npm run build'"
12+
ssh -t -i $b4a_certs_path/$pem $user@$host "sudo su back4app -c 'cp -r ~/scm/parse-dashboard ~/scm/parse-dashboard-$now && . ~/.nvm/nvm.sh && nvm use 9 && cd ~/scm/parse-dashboard && $git reset --hard && $git remote update && $git checkout $branch && $git merge origin/$branch && yarn install --production=false && npm run prepublish && npm run build'"
1213
curl -X DELETE "https://api.cloudflare.com/client/v4/zones/69ace06909c83213745231d2c6d0fd27/purge_cache" -H "X-Auth-Email: $CF_EMAIL" -H "X-Auth-Key: $CF_KEY" -H "Content-Type: application/json" --data '{"files":[
1314
"https://parse-dashboard.back4app.com/bundles/dashboard.bundle.js",
1415
"https://parse-dashboard.back4app.com/bundles/PIG.bundle.js",

0 commit comments

Comments
 (0)