Created
April 13, 2017 06:09
-
-
Save defp/ebcc4cdb71f6da840808c514445c79d7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
host="[email protected] -p 9876" | |
mac_mini="[email protected]" | |
case "$1" in | |
ssh) | |
ssh $host;; | |
code) | |
ssh -A $host -C "cd /vagrant; git pull origin master";; | |
up) | |
ssh $mac_mini -C "cd cc_server; vagrant up";; | |
reload) | |
ssh $mac_mini -C "cd cc_server; vagrant reload";; | |
start) | |
ssh -A $host -C " | |
~/bin/dotenv start-stop-daemon -d ~ --start --make-pidfile --pidfile server.pid --background --no-close --exec skynet/skynet -- config/server > ci.log 2>&1 | |
echo \"now \$(date +'%s'), server started at \"\$(redis-cli -n 0 get server:started_at) | |
";; | |
stop) | |
ssh $host -C " | |
start-stop-daemon --stop --oknodo --pidfile ~/server.pid | |
";; | |
deploy) | |
echo "before:" | |
curl -s "192.168.1.18:9750/info?git_path=/vagrant"| jq . | |
ssh -A $host " | |
cd /vagrant | |
git pull origin master | |
echo "Restarting daemon" | |
cd ~ | |
start-stop-daemon --stop --oknodo --pidfile ~/server.pid | |
~/bin/dotenv start-stop-daemon -d ~ --start --make-pidfile --pidfile server.pid --background --no-close --exec ~/skynet/skynet -- ~/config/server > ci.log 2>&1 | |
" | |
sleep 2 | |
echo "after:" | |
curl -s "192.168.1.18:9750/info?git_path=/vagrant"| jq . | |
;; | |
*) | |
ssh -A $host -C "cd /vagrant; git pull origin master" | |
ssh $host | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment