1
0
Fork 0
mirror of https://github.com/capistrano/capistrano synced 2023-03-27 23:21:18 -04:00
Remote multi-server automation tool
Find a file
2013-03-24 17:51:36 +00:00
bin installation - running cap install capifies app 2013-02-01 14:51:50 +00:00
lib auto load scm tasks based on :scm value 2013-03-24 17:51:36 +00:00
spec set defaults in a single place, call as part of setup task 2013-03-22 11:25:26 +00:00
.gitignore initial commit 2013-02-01 09:19:14 +00:00
capistrano.gemspec update gemspec 2013-03-22 16:30:24 +00:00
Gemfile initial commit 2013-02-01 09:19:14 +00:00
LICENSE.txt initial commit 2013-02-01 09:19:14 +00:00
Rakefile add default rake task for travis 2013-02-08 09:20:23 +00:00
README.md auto load scm tasks based on :scm value 2013-03-24 17:51:36 +00:00

Capistrano Build Status

wip - aim here is to get 'something' up and running

TODO:

  • harness rake for dsl

  • create a working capify equivalent

    • create Capfile
    • create lib/tasks/deploy
    • create config/deploy/
    • write config/deploy.rb with example configuration
  • basic configuration object

  • basic 'capistrano/deploy' noop example

  • before/after task hooks

  • handle multi stage

  • pass any necessary configuration from deploy.rb to SSHKit

  • support set/fetch/role configuration

  • basic deploy

  • ask

  • add deploy:check

  • prefer roles(:all) over all_roles

  • simplify default deploy

  • support setting default environment variables

  • support existing significant configuration variables

  • set configuration defaults, add commented out examples to templates

  • basic rollback

  • support primary servers on primary :db

  • rails specific tasks (see here)

  • auto load tasks for scm based on variable

  • run locally

  • better descriptions for tasks

  • add examples to README

  • add task packaging run through

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
  • lib/deploy/tasks
  • config/deploy/staging.rb
  • config/deploy/production.rb

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

Configuration

# config/deploy.rb
set :application, 'example app'

# config/deploy/production.rb
set :stage, :production

ask :branch, :master

role :app, %w{example.com example2.com}
role :web, %w{example.com}
role :db, %w{example.com}

# the first server in the array is considered primary

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

$ cap staging console

Configuration

SSHKit