Adds rake and cap tasks for loading Sidekiq::Cron::Jobs from a config
file.
You can run the rake task via:
bundle exec rake sidekiq_cron:loadIt expects a configuration file at config/sidekiq_cron.yml in this format:
default: &defaults
rake task does stuff:
cron: "42 0 * * *"
class: "RakeTaskJob"
args:
- does:stuff
development:
<<: *defaults
staging:
<<: *defaults
production:
<<: *defaultsYou can configure the location of this file, as well as name prefixes for tasks:
Sidekiq::Cron::Tasks.configure do |config|
config.file = "/custom/file/path"
config.prefix = "notmyprefix"
endYou can enable this task for Capistrano deployment. It runs around the same time that Rails' db migrations do. To enable it:
# Capfile
require 'capistrano/sidekiq-cron'Add this line to your application's Gemfile:
gem 'sidekiq-cron-tasks'And then execute:
$ bundleOr install it yourself as:
$ gem install sidekiq-cron-tasksContribution directions go here.
The gem is available as open source under the terms of the MIT License.