Skip to content

Instantly share code, notes, and snippets.

@mayra-cabrera
Last active August 29, 2015 14:11
Show Gist options
  • Save mayra-cabrera/45bd31910cff4c771314 to your computer and use it in GitHub Desktop.
Save mayra-cabrera/45bd31910cff4c771314 to your computer and use it in GitHub Desktop.
Deploy with Capistrano

From scratch

SSH as root into the server:

ssh root@123.123.123.123 # Replace with the real ip

Setup deployer user:

Create deployer user:

groupadd admin
adduser deployer --ingroup admin

Avoid a sudo hang when installing rbenv:

sudo vim /etc/sudoers
# add in the following line
%admin ALL=(ALL) NOPASSWD:ALL

Run capistrano commands

cap deploy:install
cap deploy:setup 
cap deploy:cold 

Everyday deployment

To update the code in ther server only one of these commands is need it:

cap deploy 
cap deploy:migrations # The same as the previous one, but this one also runs the pending migrations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment