deploy-to_stage.sh 1.04 KB
Newer Older
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
#!/bin/bash
# deployment script for reqesidta
# michael rauh, tobias assmann

echo "fix setup first!"
exit 1

# setup env
ENV=stage
USER=tobias
HOST=localhost
DIR=/home/tobias/Projects/reqesidta/deploy

# Synchronize this directory with the target on $HOST.
# Exclude the dev files and rename the corresponding files on the server.
rsync -av --delete --progress \
	--exclude 'docker-compose.yml' \
	--exclude 'poseidas/config/POSeIDAS.xml' \
	--exclude 'poseidas/db/poseidas.mv.db' \
	--exclude 'sam/config/ssa-server.conf' \
	--exclude 'deploy-to_*' \
	--exclude '*.dodeploy' \
	--exclude '*.dodeploy' \
	./ $USER@$HOST:$DIR

ssh $USER@$HOST "mv $DIR/docker-compose_$ENV.yml $DIR/docker-compose.yml"
ssh $USER@$HOST "mv $DIR/poseidas/config/POSeIDAS_stage.xml $DIR/poseidas/config/POSeIDAS.xml"
ssh $USER@$HOST "mv $DIR/poseidas/db/poseidas_stage.mv.db $DIR/poseidas/db/poseidas.mv.db"
ssh $USER@$HOST "mv $DIR/ssa/config/ssa-server_$ENV.yml $DIR/ssa/config/ssa-server.conf"

# Restart / re-build the services
ssh $USER@$HOST "cd $DIR/ && docker-compose up -d --build"