Skip to content

Instantly share code, notes, and snippets.

@ijin
Created December 3, 2012 01:10
Show Gist options
  • Save ijin/4191986 to your computer and use it in GitHub Desktop.
Save ijin/4191986 to your computer and use it in GitHub Desktop.
upstart script to sync deploy from admin node & restart service
description "Update source code"
start on filesystem
stop on shutdown
task
console output
script
time sudo -u deploy rsync -av --delete -e 'ssh -c arcfour -i /home/deploy/.ssh/id_dsa -o StrictHostKeyChecking=no' [email protected]:/usr/local/apps/project/ /usr/local/rails_apps/project >> /mnt/update.log 2>&1
/etc/init.d/unicorn upgrade >> /mnt/update.log 2>&1
/etc/init.d/nginx restart >> /mnt/update.log 2>&1
end script
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment