mirror of
https://github.com/capistrano/capistrano
synced 2023-03-27 23:21:18 -04:00
Remote multi-server automation tool
These tests now document how to use the Capistrano DSL to set and fetch hosts and variables using both `role` and `server` syntax |
||
|---|---|---|
| bin | ||
| lib | ||
| spec | ||
| .gitignore | ||
| capistrano.gemspec | ||
| Gemfile | ||
| LICENSE.txt | ||
| Rakefile | ||
| README.md | ||
Capistrano 
Installation
Add this line to your application's Gemfile:
gem 'capistrano', github: 'capistrano/capistrano', branch: :v3
And then execute:
$ bundle --binstubs
Capify:
$ cap install
This creates the following files:
├── Capfile
├── config
│ ├── deploy
│ │ ├── production.rb
│ │ └── staging.rb
│ └── deploy.rb
└── lib
└── capistrano
└── tasks
To create different stages:
$ cap install STAGES=local,sandbox,qa,production
Usage
$ cap -vT
$ cap staging deploy
$ cap production deploy
$ cap production deploy --dry-run
$ cap production deploy --prereqs
$ cap production deploy --trace
Tasks
Before / After
Where calling on the same task name, executed in order of inclusion
# call an existing task
before :starting, :ensure_user
after :finishing, :notify
# or define in block
before :starting, :ensure_user do
#
end
after :finishing, :notify do
#
end
Console
Execute arbitrary remote commands, to use this simply add
require 'capistrano/console' which will add the necessary tasks to your
environment:
$ cap staging console