This guide helps you migrate from capistrano-sidekiq v2.x to v3.x.
v3.0.0 removed monit support completely. The gem now only supports systemd for service management.
# Capfile
require 'capistrano/sidekiq'
install_plugin Capistrano::Sidekiq
install_plugin Capistrano::Sidekiq::Monit # No longer available# Capfile
require 'capistrano/sidekiq'
install_plugin Capistrano::Sidekiq
install_plugin Capistrano::Sidekiq::SystemdThe default role changed from :app to :worker.
# Sidekiq tasks ran on :app role by default
server 'app1.example.com', roles: [:app] # Sidekiq would run here# Sidekiq tasks now run on :worker role by default
server 'worker1.example.com', roles: [:worker] # Sidekiq runs here
# Or override the default:
set :sidekiq_roles, :app # Use old behaviorSome task names have changed or been removed:
sidekiq:monit:*tasks are completely removed- Use standard systemd tasks:
sidekiq:start,sidekiq:stop,sidekiq:restart
# Gemfile
gem 'capistrano-sidekiq', '~> 3.0'# Capfile
require 'capistrano/sidekiq'
install_plugin Capistrano::Sidekiq
install_plugin Capistrano::Sidekiq::Systemd# config/deploy.rb or config/deploy/production.rb
# If you were using :app role, explicitly set it:
set :sidekiq_roles, :app
# Or update your server definitions to use :worker role:
server 'worker1.example.com', roles: [:worker]Before your first deployment with v3.x:
# Install systemd service files on your servers
cap production sidekiq:install
# This replaces any monit configuration you hadOn your servers, remove old monit configuration files:
# On each server
sudo rm /etc/monit/conf.d/sidekiq_*
sudo monit reloadMake sure you have both lines in your Capfile:
require 'capistrano/sidekiq'
install_plugin Capistrano::Sidekiq::SystemdThis is a known issue in v3.0.0. Make sure you're using the latest version which includes the fix.
-
Check that systemd services are installed:
cap production sidekiq:install
-
Check service status:
systemctl --user status sidekiq_myapp_production
-
Ensure your servers have the
:workerrole or you've set:sidekiq_rolesappropriately.
If you encounter issues during migration:
- Check the GitHub issues
- Review the README for current configuration options
- Open a new issue with your specific migration problem