Configuring Capistrano

Ridiculous simple, let´s go:

put gem ‘capistrano’ in your Gemfile

$ bundle install

Capify your application

$ bundle exec cap install

Check this files:

├── Capfile
├── config
│ ├── deploy
│ │ ├── production.rb
│ │ └── staging.rb
│ └── deploy.rb
└── lib
___ └── capistrano
__
____ └── tasks

For create different stages

$ bundle exec cap install STAGES=development,production

Configure your sever address, folder target, public keys and roles :application :repository :deploy_to :user

This will create folders on :deploy_to server

$ bundle exec cap deploy:setup

This check your configs

$ bundle exec cap deploy:check

if you need more tasks see: deploy.rb

Example:

after "deploy", "deploy:symlink_config_files"
after "deploy", "deploy:restart"
after "deploy", "deploy:cleanup"

$ bundle exec cap [STAGE] deploy

Obs: Don`t forget uncomment Capfile: *rbenv, *bundler, *bower, *npm or *migrations if you neeed

More about Capistrano –> https://github.com/capistrano/capistrano