2017-06-12 22:32:27 +02:00
|
|
|
#!/bin/bash
|
|
|
|
host=$1
|
|
|
|
port=$2
|
|
|
|
remote="circleci@${host}"
|
|
|
|
echo "deploying..."
|
2017-11-10 18:57:36 +01:00
|
|
|
ssh -o StrictHostKeyChecking=no -p $port $remote sudo systemctl stop logmania;
|
2017-06-12 22:32:27 +02:00
|
|
|
RETVAL=$?
|
|
|
|
[ $RETVAL -ne 0 ] && exit 1
|
2017-11-10 18:57:36 +01:00
|
|
|
scp -q -P $port /go/bin/logmania $remote:~/bin/logmania;
|
2017-06-12 22:32:27 +02:00
|
|
|
RETVAL=$?
|
|
|
|
ssh -p $port $remote sudo systemctl start logmania;
|
|
|
|
[ $RETVAL -eq 0 ] && RETVAL=$?
|
|
|
|
[ $RETVAL -ne 0 ] && exit 1
|
|
|
|
echo "deployed"
|