0.0
No commit activity in last 3 years
No release in over 3 years
A Capistrano 3.x plugin for defining cap tasks that map to your application's Rake tasks.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3
>= 0

Runtime

>= 3.0.0.pre
 Project Readme

Rakeistrano

A Capistrano 3.x plugin for defining cap tasks that map to your application's Rake tasks.

Installation

Add this line to your application's Gemfile:

gem 'capistrano', '~> 3.0.0'
gem 'rakeistrano'

And then execute:

$ bundle

Or install it yourself as:

$ gem install rakeistrano

Setup

require 'rakeistrano'

Then add a file named config/rakeistrano.yml in your project using the following format:

rake_tasks:
  - task: db:seed
    role: :worker # Role to run the task on (optional, defaults to :all)
    primary: true # Whether the task should only be run on the primary of the role specified. (optional, defaults to false)

Only task is required. For example, if your YAML configuration looked like this:

rake_tasks:
  - task: cache:sweep
  - task: refresh:sitemap
    role: :app
  - task: db:update
    role: :worker
    primary: true

The following tasks would be available to you in Capistrano:

$ cap -T
cap cache:sweep                  # rake task: rake cache:sweep, role: all, primary: false
cap refresh:sitemap              # rake task: rake refresh:sitemap, role: app, primary: false
cap db:update                    # rake task: rake db:update, role: worker, primary: true

You can add as many tasks to this YAML file as you like.

Usage

Once you've set everything up, simply call your tasks directly (cap cache:sweep), or add them to your deploy flow:

namespace :deploy do
  after :publishing, 'cache:sweep'
end

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request