1
0
Fork 0
mirror of https://github.com/capistrano/capistrano synced 2023-03-27 23:21:18 -04:00
capistrano/README.md

92 lines
1.5 KiB
Markdown
Raw Normal View History

# Capistrano [![Build Status](https://travis-ci.org/capistrano/capistrano.png?branch=v3)](https://travis-ci.org/capistrano/capistrano)
2013-02-01 09:19:14 +00:00
TODO
2013-02-01 09:19:14 +00:00
## Installation
Add this line to your application's Gemfile:
2013-03-22 16:34:31 +00:00
gem 'capistrano', github: 'capistrano/capistrano', branch: :v3
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
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
## Usage
2013-02-01 09:19:14 +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
2013-02-10 17:59:06 +00:00
$ cap production deploy --dry-run
$ cap production deploy --prereqs
2013-05-24 11:01:29 +01:00
$ cap production deploy --trace
2013-02-10 17:59:06 +00:00
## Configuration
# config/deploy.rb
set :application, 'example app'
# config/deploy/production.rb
set :stage, :production
ask :branch, :master
2013-03-22 16:29:11 +00:00
role :app, %w{example.com example2.com}
role :web, %w{example.com}
role :db, %w{example.com}
2013-03-22 16:29:11 +00:00
# the first server in the array is considered primary
2013-02-08 11:15:27 +00:00
## 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
## Console
Execute arbitrary remote commands
$ cap staging console
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