If you don’t do something everyday, you tend to forget how to do it. The same is with the deployments. To help this, you can easily add a help section to Capistrano in your ‘config/deploy.rb’ file. Here is a sample:
desc "Print usage/help information" task :help do puts "Usage: cap <task> -S stage=[staging|production] -S branch=<branch_name>" puts "" puts "Examples:" puts "----------------------------------------------------------------------" puts " Production:" puts " $ cap deploy:migrations -S stage=production" puts "" puts " Staging:" puts " $ cap deploy:migrations" puts "" puts " Production with branch:" puts " $ cap deploy:migrations -S stage=production -S branch=rel_001" puts "" puts " Staging with branch:" puts " $ cap deploy:migrations -S branch=rel_001" end
When you forget how to do something, just run the following:
$ cap help Usage: cap <task> -S stage=[staging|production] -S branch=<branch_name> * executing `help' Examples: ---------------------------------------------------------------------- Production: $ cap deploy:migrations -S stage=production Staging: $ cap deploy:migrations Production with branch: $ cap deploy:migrations -S stage=production -S branch=rel_001 Staging with branch: $ cap deploy:migrations -S branch=rel_001
