Capistrano Cookbook

screenshot of Capistrano Cookbook

Capistrano Cookbook

Tasks to reduce boilerplate when deploying Rails and Sinatra apps with Capistrano 3

Overview:

Capistrano::Cookbook is a collection of Capistrano 3 Compatible tasks aimed at simplifying the deployment process of Rails and Sinatra based applications. It provides a batteries included approach to getting Rails applications up and running. The gem is tested with a specific server configuration and is intended to work in sync with the server template and the book "Reliably Deploying Rails Applications".

Features:

  • Check Revision: Verifies that the remote branch being deployed matches the current local version.
  • Compile Assets Locally: Compiles local assets and rsyncs them to the production server, saving time when deploying to multiple web frontends.
  • Create Database: Checks for a remote database.yml, copies one if it doesn't exist, creates the required user and database, and grants necessary permissions.
  • Logs: Allows remote log files to be tailed locally using Capistrano.

Installation:

To install Capistrano::Cookbook, add the following line to your application's Gemfile:

gem 'capistrano-cookbook'

Then execute:

$ bundle install

Alternatively, you can install it manually as:

$ gem install capistrano-cookbook

Summary:

Capistrano::Cookbook is a gem that enhances Capistrano 3 to simplify the deployment process of Rails and Sinatra applications. It provides a set of tasks such as checking revisions, compiling assets locally, creating databases, and logging, making it easier to manage and deploy applications. By following the installation guide and utilizing the provided features, developers can streamline their deployment workflows and ensure a smoother deployment process.