Skip to content

Instantly share code, notes, and snippets.

@josip
Last active December 15, 2015 16:29
Show Gist options
  • Select an option

  • Save josip/5289412 to your computer and use it in GitHub Desktop.

Select an option

Save josip/5289412 to your computer and use it in GitHub Desktop.
God.watch do |w|
w.name = "serif"
w.dir = '/path/to/serif/site'
w.env = {'ENV' => 'production'}
w.start = "/home/sites/serif.remote.sh"
w.stop = "kill `pidof serif`"
w.log = '/tmp/serif.unicorn.log'
w.keepalive(:memory_max => 100.megabytes,
:cpu_max => 30.percent)
end
#!/usr/bin/env bash
HOST=jlx
PASS=yourpassword
echo "Starting serif..."
ssh $HOST 'bash -s' <<EOL1
echo $PASS | sudo -S -u sites -- /usr/local/bin/god start serif
exit
EOL1
echo "SSH tunnel 8181<->4567 open"
ssh -N -L 8181:localhost:4567 $HOST
echo "Stopping serif..."
ssh $HOST 'bash -s' <<EOL2
echo $PASS | sudo -S -u sites -- /usr/local/bin/god stop serif
EOL2
#!/usr/bin/env bash
source /path/to/.rvm/environments/default
serif admin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment