A summary of data about the Ruby ecosystem.

https://github.com/capistrano/capistrano

A deployment automation tool built on Ruby, Rake, and SSH.
https://github.com/capistrano/capistrano

Keywords

capistrano deployment ruby ssh

Keywords from Contributors

activerecord activejob mvc rack rubygems sinatra sidekiq crash-reporting background-jobs devise

Last synced: about 19 hours ago
JSON representation

Repository metadata

A deployment automation tool built on Ruby, Rake, and SSH.

README.md

Capistrano: A deployment automation tool built on Ruby, Rake, and SSH.

Gem Version Build Status Code Climate CodersClan

Capistrano is a framework for building automated deployment scripts. Although Capistrano itself is written in Ruby, it can easily be used to deploy projects of any language or framework, be it Rails, Java, or PHP.

Once installed, Capistrano gives you a cap tool to perform your deployments from the comfort of your command line.

$ cd my-capistrano-enabled-project
$ cap production deploy

When you run cap, Capistrano dutifully connects to your server(s) via SSH and executes the steps necessary to deploy your project. You can define those steps yourself by writing Rake tasks, or by using pre-built task libraries provided by the Capistrano community.

Tasks are simple to make. Here's an example:

task :restart_sidekiq do
  on roles(:worker) do
    execute :service, "sidekiq restart"
  end
end
after "deploy:published", "restart_sidekiq"

Note: This documentation is for the current version of Capistrano (3.x). If you are looking for Capistrano 2.x documentation, you can find it in this archive.


Contents

Features

There are many ways to automate deployments, from simple rsync bash scripts to complex containerized toolchains. Capistrano sits somewhere in the middle: it automates what you already know how to do manually with SSH, but in a repeatable, scalable fashion. There is no magic here!

Here's what makes Capistrano great:

Strong conventions

Capistrano defines a standard deployment process that all Capistrano-enabled projects follow by default. You don't have to decide how to structure your scripts, where deployed files should be placed on the server, or how to perform common tasks: Capistrano has done this work for you.

Multiple stages

Define your deployment once, and then easily parameterize it for multiple stages (environments), e.g. qa, staging, and production. No copy-and-paste necessary: you only need to specify what is different for each stage, like IP addresses.

Parallel execution

Deploying to a fleet of app servers? Capistrano can run each deployment task concurrently across those servers and uses connection pooling for speed.

Server roles

Your application may need many different types of servers: a database server, an app server, two web servers, and a job queue work server, for example. Capistrano lets you tag each server with one or more roles, so you can control what tasks are executed where.

Community driven

Capistrano is easily extensible using the rubygems package manager. Deploying a Rails app? Wordpress? Laravel? Chances are, someone has already written Capistrano tasks for your framework of choice and has distributed it as a gem. Many Ruby projects also come with Capistrano tasks built-in.

It's just SSH

Everything in Capistrano comes down to running SSH commands on remote servers. On the one hand, that makes Capistrano simple. On the other hand, if you aren't comfortable SSH-ing into a Linux box and doing stuff on the command-line, then Capistrano is probably not for you.

Gotchas

While Capistrano ships with a strong set of conventions that are common for all types of deployments, it needs help understanding the specifics of your project, and there are some things Capistrano is not suited to do.

Project specifics

Out of the box, Capistrano can deploy your code to server(s), but it does not know how to execute your code. Does foreman need to be run? Does Apache need to be restarted? You'll need to tell Capistrano how to do this part by writing these deployment steps yourself, or by finding a gem in the Capistrano community that does it for you.

Key-based SSH

Capistrano depends on connecting to your server(s) with SSH using key-based (i.e. password-less) authentication. You'll need this working before you can use Capistrano.

Provisioning

Likewise, your server(s) will likely need supporting software installed before you can perform a deployment. Capistrano itself has no requirements other than SSH, but your application probably needs database software, a web server like Apache or Nginx, and a language runtime like Java, Ruby, or PHP. These server provisioning steps are not done by Capistrano.

sudo, etc.

Capistrano is designed to deploy using a single, non-privileged SSH user, using a non-interactive SSH session. If your deployment requires sudo, interactive prompts, authenticating as one user but running commands as another, you can probably accomplish this with Capistrano, but it may be difficult. Your automated deployments will be much smoother if you can avoid such requirements.

Shells

Capistrano 3 expects a POSIX shell like Bash or Sh. Shells like tcsh, csh, and such may work, but probably will not.

Quick start

Requirements

  • Ruby version 2.5 or higher on your local machine (MRI or Rubinius)
  • A project that uses source control (Git, Mercurial, and Subversion support is built-in)
  • The SCM binaries (e.g. git, hg) needed to check out your project must be installed on the server(s) you are deploying to
  • Bundler, along with a Gemfile for your project, are recommended

Install the Capistrano gem

Add Capistrano to your project's Gemfile using require: false:

group :development do
  gem "capistrano", "~> 3.17", require: false
end

Then run Bundler to ensure Capistrano is downloaded and installed:

$ bundle install

"Capify" your project

Make sure your project doesn't already have a "Capfile" or "capfile" present. Then run:

$ bundle exec cap install

This creates all the necessary configuration files and directory structure for a Capistrano-enabled project with two stages, staging and production:

├── Capfile
├── config
│   ├── deploy
│   │   ├── production.rb
│   │   └── staging.rb
│   └── deploy.rb
└── lib
    └── capistrano
            └── tasks

To customize the stages that are created, use:

$ bundle exec cap install STAGES=local,sandbox,qa,production

Note that the files that Capistrano creates are simply templates to get you started. Make sure to edit the deploy.rb and stage files so that they contain values appropriate for your project and your target servers.

Command-line usage

# list all available tasks
$ bundle exec cap -T

# deploy to the staging environment
$ bundle exec cap staging deploy

# deploy to the production environment
$ bundle exec cap production deploy

# simulate deploying to the production environment
# does not actually do anything
$ bundle exec cap production deploy --dry-run

# list task dependencies
$ bundle exec cap production deploy --prereqs

# trace through task invocations
$ bundle exec cap production deploy --trace

# lists all config variable before deployment tasks
$ bundle exec cap production deploy --print-config-variables

Finding help and documentation

Capistrano is a large project encompassing multiple GitHub repositories and a community of plugins, and it can be overwhelming when you are just getting started. Here are resources that can help:

Related GitHub repositories:

  • capistrano/sshkit provides the SSH behavior that underlies Capistrano (when you use execute in a Capistrano task, you are using SSHKit)
  • capistrano/rails is a very popular gem that adds Ruby on Rails deployment tasks
  • mattbrictson/airbrussh provides Capistrano's default log formatting

GitHub issues are for bug reports and feature requests. Please refer to the CONTRIBUTING document for guidelines on submitting GitHub issues.

If you think you may have discovered a security vulnerability in Capistrano, do not open a GitHub issue. Instead, please send a report to security@capistranorb.com.

How to contribute

Contributions to Capistrano, in the form of code, documentation or idea, are gladly accepted. Read the DEVELOPMENT document to learn how to hack on Capistrano's code, run the tests, and contribute your first pull request.

License

MIT License (MIT)

Copyright (c) 2012-2020 Tom Clements, Lee Hambley

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.


Owner metadata


GitHub Events

Total
Last Year

Committers metadata

Last synced: 5 days ago

Total Commits: 1,154
Total Committers: 280
Avg Commits per committer: 4.121
Development Distribution Score (DDS): 0.835

Commits in past year: 7
Committers in past year: 3
Avg Commits per committer in past year: 2.333
Development Distribution Score (DDS) in past year: 0.429

Name Email Commits
Matt Brictson m****t@m****m 190
Lee Hambley l****y@g****m 160
William Johnston w****m@j****s 112
seenmyfate s****e@g****m 110
Kir Shatrov s****v@m****m 42
Thomas Kriechbaumer k****r@g****m 32
Nick Townsend n****d@m****m 24
Huiming Teo t****g@g****m 15
Nick Townsend n****d@i****m 14
Marco van 't Wout mr@v****t 10
Bruno Sutic b****c@g****m 9
William Johnston w****l@j****t 8
Andy Sykes g****b@t****k 8
Michael Nikitochkin m****f@g****m 7
Evaldo Junior e****o@g****m 6
Yury Lebedev l****i@g****m 6
Ain Tohvri a****n@f****t 5
Isaac Betesh i****h@g****m 5
signedbyte r****r@g****m 5
Carsten Seeger c****r@e****m 5
Lee Hambley l****y@x****m 5
Yuri Artemev i@a****m 4
Troels Knak-Nielsen t****n@g****m 4
Olle Jonsson o****n@g****m 4
Rafał Lisowski l****n@g****m 4
Gareth Jones J****8@G****m 4
dependabot[bot] 4****] 4
Michal Papis m****s@g****m 4
Kai Kuchenbecker k****k@g****m 4
Dror Cohen d****o@g****m 4
and 250 more...

Committer domains:


Issue and Pull Request metadata

Last synced: 11 days ago

Total issues: 71
Total pull requests: 82
Average time to close issues: 4 months
Average time to close pull requests: 12 days
Total issue authors: 58
Total pull request authors: 30
Average comments per issue: 5.15
Average comments per pull request: 2.11
Merged pull request: 70
Bot issues: 0
Bot pull requests: 0

Past year issues: 2
Past year pull requests: 5
Past year average time to close issues: about 6 hours
Past year average time to close pull requests: 9 days
Past year issue authors: 2
Past year pull request authors: 3
Past year average comments per issue: 1.0
Past year average comments per pull request: 0.8
Past year merged pull request: 3
Past year bot issues: 0
Past year bot pull requests: 0

More stats: https://issues.ecosyste.ms/repositories/lookup?url=https://github.com/capistrano/capistrano

Top Issue Authors

  • mattbrictson (7)
  • zw963 (3)
  • mohamedhafez (2)
  • ghost (2)
  • cratag (2)
  • anshutaak (2)
  • RailsCod3rFuture (2)
  • SebastianPoell (1)
  • jaewpdev (1)
  • fishbone1 (1)
  • wdiechmann (1)
  • mohitmchavda (1)
  • doomzhou (1)
  • eloyesp (1)
  • HeppokoNeet (1)

Top Pull Request Authors

  • mattbrictson (34)
  • G-Rath (8)
  • leehambley (5)
  • miry (3)
  • taketo1113 (3)
  • paulschreiber (2)
  • rolandasb (2)
  • eric-eye (2)
  • emanulato (2)
  • HLFH (1)
  • intrip (1)
  • y-yagi (1)
  • mvastola (1)
  • coffeeaddict (1)
  • dr5hn (1)

Top Issue Labels

  • help wanted (6)
  • need more info (2)
  • bug? (2)
  • new feature (2)
  • documentation (1)
  • discuss! (1)
  • 🏠 Housekeeping (1)

Top Pull Request Labels

  • 🏠 Housekeeping (32)
  • 📚 Docs (9)
  • 🐛 Bug Fix (8)
  • ✨ Feature (7)
  • v2 (3)
  • documentation (2)
  • ⚠️ Breaking (2)

Package metadata

rubygems.org: capistrano

Capistrano is a utility and framework for executing commands in parallel on multiple remote machines, via SSH.

  • Homepage: https://capistranorb.com/
  • Documentation: http://www.rubydoc.info/gems/capistrano/
  • Licenses: MIT
  • Latest release: 3.19.2 (published about 1 year ago)
  • Last Synced: 2025-12-08T21:33:36.643Z (2 days ago)
  • Versions: 116
  • Dependent Packages: 1,307
  • Dependent Repositories: 41,415
  • Downloads: 84,417,445 Total
  • Docker Downloads: 17,704,121
  • Rankings:
    • Dependent packages count: 0.037%
    • Stargazers count: 0.092%
    • Forks count: 0.138%
    • Dependent repos count: 0.163%
    • Downloads: 0.246%
    • Average: 0.298%
    • Docker downloads count: 1.112%
  • Maintainers (3)
gem.coop: capistrano

Capistrano is a utility and framework for executing commands in parallel on multiple remote machines, via SSH.

  • Homepage: https://capistranorb.com/
  • Documentation: http://www.rubydoc.info/gems/capistrano/
  • Licenses: MIT
  • Latest release: 3.19.2 (published about 1 year ago)
  • Last Synced: 2025-12-09T14:01:55.001Z (1 day ago)
  • Versions: 116
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 84,432,594 Total
  • Docker Downloads: 17,704,121
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Downloads: 0.305%
    • Average: 0.33%
    • Docker downloads count: 1.014%
  • Maintainers (3)
gem.coop: HeSYINUvSBZfxqA-capistrano

Capistrano is a utility and framework for executing commands in parallel on multiple remote machines, via SSH.

  • Homepage: http://github.com/capistrano/capistrano
  • Documentation: http://www.rubydoc.info/gems/HeSYINUvSBZfxqA-capistrano/
  • Licenses: mit
  • Latest release: 2.5.28 (published over 13 years ago)
  • Last Synced: 2025-12-07T21:03:00.337Z (3 days ago)
  • Versions: 8
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 31,831 Total
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 6.881%
    • Downloads: 20.644%
  • Maintainers (1)
rubygems.org: HeSYINUvSBZfxqA-capistrano

Capistrano is a utility and framework for executing commands in parallel on multiple remote machines, via SSH.

  • Homepage: http://github.com/capistrano/capistrano
  • Documentation: http://www.rubydoc.info/gems/HeSYINUvSBZfxqA-capistrano/
  • Licenses: mit
  • Latest release: 2.5.28 (published over 13 years ago)
  • Last Synced: 2025-12-07T21:02:59.057Z (3 days ago)
  • Versions: 8
  • Dependent Packages: 3
  • Dependent Repositories: 1
  • Downloads: 31,831 Total
  • Rankings:
    • Stargazers count: 0.091%
    • Forks count: 0.134%
    • Dependent packages count: 3.985%
    • Average: 9.222%
    • Downloads: 20.107%
    • Dependent repos count: 21.793%
  • Maintainers (1)

Dependencies

.github/workflows/push.yml actions
  • actions/checkout master composite
  • toolmantim/release-drafter v5.2.0 composite
Gemfile rubygems
  • cucumber < 3.0.1 development
  • cucumber >= 0 development
  • danger >= 0
  • i18n < 1.3.0
  • mocha >= 0
  • net-ssh < 5.0.0
  • psych < 4
  • public_suffix < 3.0.0
  • rake < 13.0.0
  • rspec >= 0
  • rspec-core ~> 3.4.4
  • rubocop = 0.48.1
capistrano.gemspec rubygems
  • airbrussh >= 1.0.0
  • i18n >= 0
  • rake >= 10.0.0
  • sshkit >= 1.9.0
docs/Gemfile rubygems
  • github-pages >= 0
docs/Gemfile.lock rubygems
  • activesupport 4.2.10
  • addressable 2.5.2
  • coffee-script 2.4.1
  • coffee-script-source 1.11.1
  • colorator 1.1.0
  • commonmarker 0.17.13
  • concurrent-ruby 1.0.5
  • dnsruby 1.61.2
  • em-websocket 0.5.1
  • ethon 0.11.0
  • eventmachine 1.2.7
  • execjs 2.7.0
  • faraday 0.15.3
  • ffi 1.9.25
  • forwardable-extended 2.6.0
  • gemoji 3.0.0
  • github-pages 192
  • github-pages-health-check 1.8.1
  • html-pipeline 2.8.4
  • http_parser.rb 0.6.0
  • i18n 0.9.5
  • jekyll 3.7.4
  • jekyll-avatar 0.6.0
  • jekyll-coffeescript 1.1.1
  • jekyll-commonmark 1.2.0
  • jekyll-commonmark-ghpages 0.1.5
  • jekyll-default-layout 0.1.4
  • jekyll-feed 0.10.0
  • jekyll-gist 1.5.0
  • jekyll-github-metadata 2.9.4
  • jekyll-mentions 1.4.1
  • jekyll-optional-front-matter 0.3.0
  • jekyll-paginate 1.1.0
  • jekyll-readme-index 0.2.0
  • jekyll-redirect-from 0.14.0
  • jekyll-relative-links 0.5.3
  • jekyll-remote-theme 0.3.1
  • jekyll-sass-converter 1.5.2
  • jekyll-seo-tag 2.5.0
  • jekyll-sitemap 1.2.0
  • jekyll-swiss 0.4.0
  • jekyll-theme-architect 0.1.1
  • jekyll-theme-cayman 0.1.1
  • jekyll-theme-dinky 0.1.1
  • jekyll-theme-hacker 0.1.1
  • jekyll-theme-leap-day 0.1.1
  • jekyll-theme-merlot 0.1.1
  • jekyll-theme-midnight 0.1.1
  • jekyll-theme-minimal 0.1.1
  • jekyll-theme-modernist 0.1.1
  • jekyll-theme-primer 0.5.3
  • jekyll-theme-slate 0.1.1
  • jekyll-theme-tactile 0.1.1
  • jekyll-theme-time-machine 0.1.1
  • jekyll-titles-from-headings 0.5.1
  • jekyll-watch 2.0.0
  • jemoji 0.10.1
  • kramdown 1.17.0
  • liquid 4.0.0
  • listen 3.1.5
  • mercenary 0.3.6
  • mini_portile2 2.4.0
  • minima 2.5.0
  • minitest 5.11.3
  • multipart-post 2.0.0
  • nokogiri 1.10.8
  • octokit 4.12.0
  • pathutil 0.16.1
  • public_suffix 2.0.5
  • rb-fsevent 0.10.3
  • rb-inotify 0.9.10
  • rouge 2.2.1
  • ruby-enum 0.7.2
  • ruby_dep 1.5.0
  • rubyzip 2.2.0
  • safe_yaml 1.0.4
  • sass 3.6.0
  • sass-listen 4.0.0
  • sawyer 0.8.1
  • terminal-table 1.8.0
  • thread_safe 0.3.6
  • typhoeus 1.3.0
  • tzinfo 1.2.5
  • unicode-display_width 1.4.0

Score: 34.23836307360001