hook2xmpp/deploy.sh

15 lines
373 B
Bash
Raw Normal View History

2017-06-09 14:27:06 +02:00
#!/bin/bash
host=$1
port=$2
remote="circleci@${host}"
echo "deploying..."
ssh -p $port $remote sudo systemctl stop hook2xmpp;
RETVAL=$?
[ $RETVAL -ne 0 ] && exit 1
scp -q -P $port ~/.go_workspace/bin/hook2xmpp $remote:~/bin/hook2xmpp;
RETVAL=$?
ssh -p $port $remote sudo systemctl start hook2xmpp;
[ $RETVAL -eq 0 ] && RETVAL=$?
[ $RETVAL -ne 0 ] && exit 1
echo "deployed"