Sha256: 6965cf04ace86cbf26768ce8bd39a93eff538938e85d1281c78707865a361991

Contents?: true

Size: 1.03 KB

Versions: 41

Compression:

Stored size: 1.03 KB

Contents

module CapistranoDeployManagement
  module Whenever
    def self.load_into(configuration)
      configuration.load do

        set :whenever_cmd do
          if using_recipe?(:bundle)
            'bundle exec whenever'
          else
            'whenever'
          end
        end

        set :whenever_identifier do
          if using_recipe?(:multistage)
            "#{application}_#{current_stage}"
          else
            application
          end
        end

        namespace :whenever do
          desc 'Update crontab file'
          task :update_crontab, :roles => :db, :only => {:primary => true} do
            run "cd #{current_path} && #{whenever_cmd} --update-crontab #{whenever_identifier}"
          end

          desc 'Clear crontab file'
          task :clear_crontab, :roles => :db, :only => {:primary => true} do
            run "cd #{current_path} && #{whenever_cmd} --clear-crontab #{whenever_identifier}"
          end
        end

        after 'deploy:restart', 'whenever:update_crontab'

      end
    end
  end
end

Version data entries

41 entries across 41 versions & 1 rubygems

Version Path
capistrano-deploy-management-0.1.25 lib/capistrano-deploy-management/whenever.rb
capistrano-deploy-management-0.1.24 lib/capistrano-deploy-management/whenever.rb
capistrano-deploy-management-0.1.23 lib/capistrano-deploy-management/whenever.rb
capistrano-deploy-management-0.1.22 lib/capistrano-deploy-management/whenever.rb
capistrano-deploy-management-0.1.21 lib/capistrano-deploy-management/whenever.rb
capistrano-deploy-management-0.1.20 lib/capistrano-deploy-management/whenever.rb
capistrano-deploy-management-0.1.19 lib/capistrano-deploy-management/whenever.rb
capistrano-deploy-management-0.1.18 lib/capistrano-deploy-management/whenever.rb
capistrano-deploy-management-0.1.17 lib/capistrano-deploy-management/whenever.rb
capistrano-deploy-management-0.1.16 lib/capistrano-deploy-management/whenever.rb
capistrano-deploy-management-0.1.15 lib/capistrano-deploy-management/whenever.rb
capistrano-deploy-management-0.1.14 lib/capistrano-deploy-management/whenever.rb
capistrano-deploy-management-0.1.13 lib/capistrano-deploy-management/whenever.rb
capistrano-deploy-management-0.1.12 lib/capistrano-deploy-management/whenever.rb
capistrano-deploy-management-0.1.11 lib/capistrano-deploy-management/whenever.rb
capistrano-deploy-management-0.1.10 lib/capistrano-deploy-management/whenever.rb
capistrano-deploy-management-0.1.9 lib/capistrano-deploy-management/whenever.rb
capistrano-deploy-management-0.1.8 lib/capistrano-deploy-management/whenever.rb
capistrano-deploy-management-0.1.7 lib/capistrano-deploy-management/whenever.rb
capistrano-deploy-management-0.1.6 lib/capistrano-deploy-management/whenever.rb