2013-02-01 09:19:14 +00:00
|
|
|
# Capistrano
|
|
|
|
|
2013-02-01 14:41:51 +00:00
|
|
|
wip - aim here is to get 'something' up and running
|
|
|
|
|
2013-02-01 15:32:18 +00:00
|
|
|
TODO:
|
2013-02-01 14:41:51 +00:00
|
|
|
|
2013-02-01 15:32:18 +00:00
|
|
|
- [x] harness rake for dsl
|
|
|
|
- [x] create a working capify equivalent
|
|
|
|
- [x] create Capfile
|
|
|
|
- [x] create lib/tasks/deploy
|
|
|
|
- [x] create config/deploy/
|
|
|
|
- [x] write config/deploy.rb with example configuration
|
2013-02-01 14:41:51 +00:00
|
|
|
|
2013-02-01 15:32:18 +00:00
|
|
|
- [x] basic configuration object
|
|
|
|
- [x] basic 'capistrano/deploy' noop example
|
|
|
|
- [x] don't care too much about testing at this point (rspec included for my reference)
|
2013-02-01 14:41:51 +00:00
|
|
|
|
2013-02-08 09:15:10 +00:00
|
|
|
- [x] before/after task hooks
|
2013-02-08 11:15:27 +00:00
|
|
|
- [x] handle multi stage
|
|
|
|
- [ ] pass any necessary configuration from deploy.rb to SSHKit
|
|
|
|
- [ ] is Capfile still legit? (although capfile/capfile.rb are already alternatives by default)
|
2013-02-01 09:19:14 +00:00
|
|
|
|
|
|
|
## Installation
|
|
|
|
|
|
|
|
Add this line to your application's Gemfile:
|
|
|
|
|
2013-02-01 15:32:18 +00:00
|
|
|
gem 'capistrano' github: 'capistrano/capistrano', branch: :wip
|
2013-02-01 09:19:14 +00:00
|
|
|
|
|
|
|
And then execute:
|
|
|
|
|
2013-02-08 11:15:27 +00:00
|
|
|
$ bundle --binstubs
|
2013-02-01 09:19:14 +00:00
|
|
|
|
2013-02-01 14:41:51 +00:00
|
|
|
Capify:
|
|
|
|
|
2013-02-08 11:15:27 +00:00
|
|
|
$ cap install
|
|
|
|
|
|
|
|
This creates the following files:
|
|
|
|
|
|
|
|
- `Capfile`
|
|
|
|
- `lib/deploy/tasks`
|
|
|
|
- `config/deploy/staging.rb`
|
|
|
|
- `config/deploy/production.rb`
|
|
|
|
|
|
|
|
To create different stages:
|
|
|
|
|
|
|
|
$ cap install STAGES=local,sandbox,qa,production
|
2013-02-01 09:19:14 +00:00
|
|
|
|
2013-02-01 14:41:51 +00:00
|
|
|
## Usage
|
2013-02-01 09:19:14 +00:00
|
|
|
|
2013-02-01 14:41:51 +00:00
|
|
|
$ cap -vT
|
2013-02-01 09:19:14 +00:00
|
|
|
|
2013-02-08 11:15:27 +00:00
|
|
|
$ cap staging deploy
|
|
|
|
$ cap production deploy
|
|
|
|
|
|
|
|
## Tasks
|
2013-02-08 09:15:10 +00:00
|
|
|
|
|
|
|
## 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
|
|
|
|
|
2013-02-08 11:15:27 +00:00
|
|
|
## Configuration
|
2013-02-08 09:15:10 +00:00
|
|
|
|
|
|
|
|
2013-02-08 11:15:27 +00:00
|
|
|
## SSHKit
|
2013-02-08 09:15:10 +00:00
|
|
|
|
|
|
|
|
|
|
|
|