Capistrano3 tasks for manage long running rake tasks or daemons via runit supervisor.
Add this line to your application's Gemfile:
gem 'capistrano-runit-rake'
And then execute:
$ bundle
Or install it yourself as:
$ gem install capistrano-runit-rake
runit:rake:start
-- start all rake tasks.runit:rake:stop
-- stop all rake tasks.runit:rake:restart
-- restart all rake tasks.runit:rake:foo:setup
-- setupfoo
rake task service.runit:rake:foo:enable
-- enablefoo
rake task service.runit:rake:foo:disable
-- disablefoo
rake task service.runit:rake:foo:start
-- startfoo
rake task service.runit:rake:foo:stop
-- stopfoo
rake task service.
runit_rake_role
-- what host roles uses runit to run rake long running tasks. Default value::app
runit_rake_foo_role
-- what host roles uses runit to run rake long running task with keyfoo
. Default value::app
runit_rake_tasks
-- Hash of rake tasks. Default value:{}
Add this line in Capfile
:
require 'capistrano/runit/rake'
Add your tasks in config/deploy.rb
:
set :runit_rake_tasks, {
'foo' => 'daemon:bar'
}
set :runit_rake_foo_role, :db # change role for foo rake task
- Fork it ( https://github.com/capistrano-runit/rake/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request