forked from Duke-MatSci/nanomine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsynccode
executable file
·30 lines (24 loc) · 1.08 KB
/
synccode
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
#!/bin/bash
nobld=${1-:''}
echo "synccode started: $(date)"
rsync -avz -e "ssh " --exclude="venv/*" --exclude="static/*" --exclude="dist/*" --exclude=".git/*" --exclude="node_modules/*" . whyis:/apps/nanomine/
rsync -avz -e "ssh " --exclude="venv/*" --exclude="static/*" --exclude="dist/*" --exclude=".git/*" --exclude="node_modules/*" ../mm-model-viewers/ whyis:/apps/mm-model-viewers/
ssh whyis "cd mm-model-viewers; npm run build:release"
echo "For testing package.json changes, uncomment the line that re-creates all node_modules."
#ssh whyis "cd nanomine;rm -rf node_modules; npm i"
if [[ $nobld == "nobld" ]] ; then
echo NOT running build of vue app
else
echo Running build of vue app
ssh whyis "cd nanomine;npm run build"
echo completed build of vue app
fi
echo STOPPING apache2 and nm-rest
ssh whyisroot "systemctl stop apache2"
ssh whyisroot "systemctl stop nm-rest"
echo Cleaning server log
ssh whyis "rm /apps/nanomine/rest/nanomine*.log"
echo Starting nm-rest and apache2
ssh whyisroot "systemctl start nm-rest"
ssh whyisroot "systemctl start apache2"
echo "synccode ended: $(date)"