forked from XimeraProject/server
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.sh
More file actions
26 lines (26 loc) · 1.05 KB
/
deploy.sh
File metadata and controls
26 lines (26 loc) · 1.05 KB
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
#!/bin/bash
if [ $(hostname) = ximera-1.asc.ohio-state.edu ]; then
echo On the deployment machine.
echo Pulling latest version from github...
mv -f environment.sh environment.backup
git pull
mv -f environment.backup environment.sh
echo Updating npm...
npm install
echo Running gulp...
node ./node_modules/gulp/bin/gulp.js js
node ./node_modules/gulp/bin/gulp.js css
echo Stopping old copies of app.js...
./node_modules/forever/bin/forever -c /home/deploy/local/bin/node stop ximera
echo Starting a new copy of app.js...
source environment.sh
export DEPLOYMENT=production
export NODE_ENV=production
./node_modules/forever/bin/forever -c /home/deploy/local/bin/node --uid "ximera" start -a -l forever.log -o out.log -e err.log app.js &
else
echo not on the deployment machine...
echo copying environment to deployment machine...
rsync -avz -f"- .git/" environment.sh ximera:/var/www/apps/ximera
echo ssh to the deploy machine...
ssh ximera "cd /var/www/apps/ximera ; source deploy.sh"
fi