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.
2017-05-17 21:33:23 +02:00
|
|
|
#!/bin/bash
|
2017-05-18 00:34:26 +02:00
|
|
|
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=$?
|
2017-06-05 23:27:27 +02:00
|
|
|
# sed -ie 's/http:\/\/localhost:8080/https:\/\/stock.pub.warehost.de/g' webroot/static/js/main.js
|
|
|
|
# [ $RETVAL -eq 0 ] && RETVAL=$?
|
2017-05-18 00:34:26 +02:00
|
|
|
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"
|