lib/capistrano/sidekiq.rb in capistrano-sidekiq-1.0.3 vs lib/capistrano/sidekiq.rb in capistrano-sidekiq-2.0.0.beta1

- old
+ new

@@ -1,28 +1,56 @@ -load File.expand_path('../tasks/sidekiq.rake', __FILE__) +require 'capistrano/bundler' +require "capistrano/plugin" + +module Capistrano + class Sidekiq < Capistrano::Plugin + def define_tasks + eval_rakefile File.expand_path('../tasks/sidekiq.rake', __FILE__) + end + + def set_defaults + set_if_empty :sidekiq_default_hooks, true + + set_if_empty :sidekiq_env, -> { fetch(:rack_env, fetch(:rails_env, fetch(:rake_env, fetch(:stage)))) } + set_if_empty :sidekiq_roles, fetch(:sidekiq_role, :app) + set_if_empty :sidekiq_log, -> { File.join(shared_path, 'log', 'sidekiq.log') } + # Rbenv, Chruby, and RVM integration + append :rbenv_map_bins, 'sidekiq', 'sidekiqctl' + append :rvm_map_bins, 'sidekiq', 'sidekiqctl' + append :chruby_map_bins, 'sidekiq', 'sidekiqctl' + # Bundler integration + append :bundle_bins, 'sidekiq', 'sidekiqctl' + end + + end +end + +require_relative 'sidekiq/systemd' +require_relative 'sidekiq/upstart' +require_relative 'sidekiq/monit'