saizai's superdeploy at master - GitHub

Posted Almost 15 years ago by Lexy.
github.com

A collection of useful utilities for Capistrano deployments

Showing a custom maintenance page while deploying

Posted About 8 years ago by Pascal Roth.
github.com

Installation Add this line to your application's Gemfile: gem 'capistrano', '~> 3.0' gem 'capistrano-maintenance', '~> 1.0' Add this line to you application's Capfile: require 'capistrano/maintenance'

...will make your application web-accessible again. Manual steps If you are still on capistrano 1, you can enable and disable the maintenance page manually. First, prepare a maintenance.html, for...

Capistrano: Doing things on rollback

Posted Almost 7 years ago by Dominik Schöler.

Capistrano has the concept of a "rollback" that comes in really handy in case of errors. When you notice that your recent deploy was faulty, run cap deploy:rollback and...

...re back with the previous release. In case of an error during a deployment, Capistrano will rollback itself. But, you may ask, how can it know how to revert all...

How to use the Capistrano 2 shell to execute commands on servers

Posted Over 10 years ago by Arne Hartherz.
weblog.jamisbuck.org

Capistrano 2 brings the shell command which allows you to run commands on your deployment targets. There is also invoke to run a command directly from your terminal.

...allow running Capistrano tasks or shell commands, and scope to individual machines or machine roles. Unfortunately Capistrano 3 does not include these commands any more. cap shell Basics

Capistrano 2: How to deploy a single server

Posted Almost 7 years ago by Dominik Schöler.

...way to do this: the HOSTFILTER env variable. Commenting out "server" lines in the Capistrano deploy config will raise a Capistrano::NoMatchingServersError with is only run for servers matching {:roles...

...matched. Instead, specify the server-under-test like this: HOSTFILTER=separate-sidekiq.makandra.de cap production deploy Capistrano is aware of this env variable and will only deploy that single server, skipping any...

How to fix "Too many authentic authentication failures" with SSH and/or Capistrano

Posted Over 13 years ago by Henning Koch.

You are getting when connecting via SSH or deploying with Capistrano (which uses SSH): Too many authentication failures for username This is caused by having too many SSH keys added...

...involves you keeping many keys will cause you pain. Painful fix for SSH and Capistrano: Add keys manually You will need to disable your gnome keyring daemon to regain control...

no passenger served applications running error when deploying via capistrano

Posted Almost 5 years ago by Claus-Theodor Riegg.

When deploying with capistrano it's possible you get this "error" message: *** [err :: example.com] There are no Phusion Passenger-served applications running whose paths begin with '/var/www/example.com'. *** [err :: example.com]

...this error, the configuration option --ignore-app-not-running is not set. We recommend using capistrano-passenger which has this option set as default. See How to let passenger restart...

Geordi: run a capistrano task on all stages

Posted Over 11 years ago by Tobias Kraze.

Geordi now has a script that runs capistrano with all known deploy targets (i.e. staging, production…). Use with geordi capistrano deploy:migrations or geordi capistrano deploy The abbrevation geordi cap...

How to fix "unknown role" errors in Capistrano recipes

Posted Over 12 years ago by Arne Hartherz.

# do crazy stuff end end Whenever we call foo.bar in our recipe, Capistrano will fail if you deploy to a stage where none of the servers has the...

...a roles[:something] into your deploy.rb to avoid the above error message.\ Now, when Capistrano enters a hook and tries to call a method that is only available for that...

Speed up Capistrano deployments using a remote cached copy of repository

Posted Almost 13 years ago by Thomas Eisenbarth.

You can seriously speed up deployments with Capistrano when using a local git repository on the server you are deploying to. Simply add set :deploy_via, :remote_cache

...exclude, [ '.git' ] to your config/deploy.rb and Capistrano will create a clone in shared/cached-copy. This will be updated using git pull when deploying which transfers less bytes and is usually much...

Capistrano: Finding out who deployed which revision of your application and when

Posted Over 4 years ago by Arne Hartherz.

Capistrano automatically logs each (successful) deployment into a file on your application servers. It is located at the root of your server's project folder, i.e. the parent of releases...

...currently deployed revision, we also have a card on this. It also contains a Capistrano task that can be called from developer machines...

Capistrano task to tail remote application logs of multiple servers

Posted About 6 years ago by Arne Hartherz.

...are stored per server (unless you choose a centralized logging solution). Here is a Capistrano task that connects to all servers and prints logs to your terminal like this:

...use the LOG env variable, like LOG=sidekiq cap production app:logs. Note that Capistrano truncates lines that are longer than your terminal. This can be painful when looking at...

How to make Capistrano not truncate server output

Posted About 6 years ago by Arne Hartherz.

By default, Capistrano truncates server responses and places an ellipsis at the end of lines that are longer than your terminal. Error messages are never truncated. While this can be...

...knowing what is going on, even if causes a few extra lines of output. Capistrano by default uses Airbrussh which is where truncation happens. To disable truncation globally, place this...

Capistrano: Bundler stalls and asks for "Username"

Posted About 11 years ago by Thomas Eisenbarth.

Given you use Capistrano together with bundler to automatically install your gems when deploying. I recently had the problem that Capistrano stalled like this: [err :: host.name.tld] Username:

Script to open an SSH shell to a Capistrano deployment target

Posted Almost 13 years ago by Dominik Schöler.

...connect to the server in order to e.g. access the production console. Guessing the Capistrano deploy user and then again guessing the right directory on the server is awkward, so...

...handy command shell-for. Run it from any project directory like this, passing a Capistrano multistage deployment target: shell-for staging Now it also supports commands to be remotely executed...

Capistrano + Rails: Tagging production deploys

Posted Almost 6 years ago by Dominik Schöler.

...track production deploys within the commit history. This task does the tagging for you. Capistrano 3 # lib/capistrano/tasks/deploy.rb namespace :deploy do ... desc 'Tag the deployed revision' task :tag_revision do

Capistrano: exclude custom bundle groups for production deploy

Posted Over 7 years ago by Daniel Straßner.

Capistrano is by default configured to exclude the gems of the groups development and test when deploying to the stages production and staging. Whenever you create custom groups in your...

Fix capistrano errors: "no such file to load -- net/ssh/authentication/agent/socket" or "uninitialized constant Net::SSH::KnownHosts::SUPPORTED_TYPE"

Posted Almost 12 years ago by Tobias Kraze.

There is a conflict between current capistrano versions and the 2.5.1 net-ssh gem. Make sure you upgrade to 2.5.2, then it should work again...

Resque + God + Capistrano

Posted Over 12 years ago by Tobias Kraze.

Attached is a working config to deploy an application with Capistrano that needs to monitor Resque workers with God. God will run as the deployment user, no need to register...

console-for opens a Rails console remotely on a Capistrano deployment target

Posted Almost 13 years ago by Dominik Schöler.

...script is relying on. Run it from any project directory like this, passing a Capistrano multistage deployment target: console-for staging This script is part of our geordi gem on...

Deploy and migrate with a single Capistrano command

Posted About 13 years ago by Henning Koch.

...and run all pending migrations before restarting it, you can use the following standard Capistrano task: cap deploy:migrations Little is known what happens when the deployment goes through, but...

Show the description of a Capistrano task

Posted About 13 years ago by Henning Koch.

In order to bring up a textual description of a Capistrano task you can say cap -e taskname ... where taskname is the name of the task you're not sure...

Capistrano 3: How to deploy when a firewall blocks your git repo

Posted Almost 7 years ago by Tobias Kraze.

Sometimes, through some firewall or proxy misconfiguration, you might have to deploy to a server that cannot access the git...

Fix Capistrano warnings: Missing public directories

Posted Almost 12 years ago by Henning Koch.

I got these warnings while deploying a Rails 3.2 app with asset pipeline enabled: *** [err :: host.tld] find: `/opt/www/hollyapp.com/releases/20120503115342/public/images': No such...