Sha256: 4d7b568000ed74bef817887394e68b481a1243969813de7f482f4f8b2c7dd63c
Contents?: true
Size: 1.14 KB
Versions: 7
Compression:
Stored size: 1.14 KB
Contents
namespace :deploy do before :starting, "deploy:sidekiq:deployment_hooks" namespace :sidekiq do task :deployment_hooks do after 'deploy:starting', 'deploy:sidekiq:stop' after 'deploy:updated', 'deploy:sidekiq:update' after 'deploy:reverted', 'deploy:sidekiq:stop' after 'deploy:published', 'deploy:sidekiq:start' end task :update do on roles(:sidekiq) do service "#{fetch(:application)}-sidekiq" do user fetch(:user) working_dir current_path start "bundle exec sidekiq -e '#{fetch(:framework_env)}' -C '#{current_path}/config/sidekiq.yml' -L '#{current_path}/log/sidekiq.log' -P '#{current_path}/tmp/pids/sidekiq.pid' #{fetch(:sidekiq_options)}" stop "bundle exec sidekiqctl stop '#{current_path}/tmp/pids/sidekiq.pid' 10" end end end task :start do on roles(:sidekiq) do sudo "/etc/init.d/#{fetch(:application)}-sidekiq" , :start end end task :stop do on roles(:sidekiq) do sudo "/etc/init.d/#{fetch(:application)}-sidekiq stop || true" end end task restart: [:stop, :start] end end
Version data entries
7 entries across 7 versions & 1 rubygems