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.47 lib/capistrano-deploy-management/whenever.rb
capistrano-deploy-management-0.1.46 lib/capistrano-deploy-management/whenever.rb
capistrano-deploy-management-0.1.45 lib/capistrano-deploy-management/whenever.rb
capistrano-deploy-management-0.1.44 lib/capistrano-deploy-management/whenever.rb
capistrano-deploy-management-0.1.43 lib/capistrano-deploy-management/whenever.rb
capistrano-deploy-management-0.1.42 lib/capistrano-deploy-management/whenever.rb
capistrano-deploy-management-0.1.41 lib/capistrano-deploy-management/whenever.rb
capistrano-deploy-management-0.1.40 lib/capistrano-deploy-management/whenever.rb
capistrano-deploy-management-0.1.39 lib/capistrano-deploy-management/whenever.rb
capistrano-deploy-management-0.1.38 lib/capistrano-deploy-management/whenever.rb
capistrano-deploy-management-0.1.37 lib/capistrano-deploy-management/whenever.rb
capistrano-deploy-management-0.1.36 lib/capistrano-deploy-management/whenever.rb
capistrano-deploy-management-0.1.35 lib/capistrano-deploy-management/whenever.rb
capistrano-deploy-management-0.1.34 lib/capistrano-deploy-management/whenever.rb
capistrano-deploy-management-0.1.33 lib/capistrano-deploy-management/whenever.rb
capistrano-deploy-management-0.1.32 lib/capistrano-deploy-management/whenever.rb
capistrano-deploy-management-0.1.31 lib/capistrano-deploy-management/whenever.rb
capistrano-deploy-management-0.1.30 lib/capistrano-deploy-management/whenever.rb
capistrano-deploy-management-0.1.29 lib/capistrano-deploy-management/whenever.rb
capistrano-deploy-management-0.1.28 lib/capistrano-deploy-management/whenever.rb