-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·37 lines (29 loc) · 1.01 KB
/
deploy.sh
File metadata and controls
executable file
·37 lines (29 loc) · 1.01 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
27
28
29
30
31
32
33
34
35
36
37
# TARGET_HOST=bgirschig@80.236.31.52 # barbes network
# TARGET_HOST=bgirschig@192.168.1.218 # la cense network
TARGET_HOST=bgirschig@192.168.0.100 # musée de l'elysée
TARGET_DIR=/Users/Shared/field
ssh $TARGET_HOST <<- EOF
mkdir -p $TARGET_DIR
EOF
scp ./start.sh $TARGET_HOST:$TARGET_DIR/
# Build and deploy frontend
yarn run build
rsync -rlDuvh ./dist/* $TARGET_HOST:$TARGET_DIR/frontend
# deploy detector service
cd ./server
source ./env/bin/activate
/usr/local/bin/pip freeze > requirements.txt
rsync -rlDuvh ./* --exclude env/ --exclude recordings/ $TARGET_HOST:$TARGET_DIR/server
deactivate
ssh $TARGET_HOST <<- EOF
cd $TARGET_DIR/server
if [ ! -d env ]; then
/Library/Frameworks/Python.framework/Versions/2.7/bin/virtualenv env
fi
# This does not work, because the $PATH is the deployer computer's PATH. This
# is possibly because this is not an interactive shell (?)
#
# source env/bin/activate
# pip install -r requirements.txt
echo $(date +'%m/%d/%Y %r') ' - update' >> ~/Desktop/log.txt
EOF