genofire/hs_monolith
genofire
/
hs_monolith
Archived
1
0
Fork 0
This repository has been archived on 2020-09-27. You can view files and clone it, but cannot push or open issues or pull requests.
hs_monolith/deploy.sh

21 lines
672 B
Bash
Executable File

#!/bin/bash
host=$1
port=$2
remote="circleci@${host}"
echo "deploying..."
ssh -p $port $remote sudo systemctl stop stock;
RETVAL=$?
[ $RETVAL -ne 0 ] && exit 1
scp -q -P $port ~/.go_workspace/bin/stock $remote:~/bin/stock;
RETVAL=$?
sed -ie 's/http:\/\/localhost:8080/https:\/\/stock.pub.warehost.de/g' webroot/static/js/main.js
[ $RETVAL -eq 0 ] && RETVAL=$?
rsync -e "ssh -p $port" -a webroot/ $remote:~/lib/stock/www;
[ $RETVAL -eq 0 ] && RETVAL=$?
rsync -e "ssh -p $port" -a contrib/ $remote:~/lib/stock/contrib;
[ $RETVAL -eq 0 ] && RETVAL=$?
ssh -p $port $remote sudo systemctl start stock;
[ $RETVAL -eq 0 ] && RETVAL=$?
[ $RETVAL -ne 0 ] && exit 1
echo "deployed"