From c9855eb08f8dad8f930393d162a76e5995b528e3 Mon Sep 17 00:00:00 2001 From: Stuart Watson Date: Fri, 1 Nov 2019 13:13:07 +0000 Subject: [PATCH 1/2] Added fix for sidekiq issue --- config/deploy.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config/deploy.rb b/config/deploy.rb index b2894bf7b..fbe33ba34 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -5,7 +5,8 @@ set :repo_url, 'git@github.com:unepwcmc/ProtectedPlanet.git' set :init_system, :systemd -set :service_unit_name, "sidekiq_#{fetch(:application)}.service" +set :service_unit_name, "sidekiq_pp.service" +set :service_unit_name, "sidekiq_import_pp.service" set :deploy_user, 'wcmc' set :deploy_to, "/home/#{fetch(:deploy_user)}/#{fetch(:application)}" From 5d6fd353b037befb132b8a3ac8a250923f75f6a6 Mon Sep 17 00:00:00 2001 From: Stuart Watson Date: Fri, 1 Nov 2019 13:52:21 +0000 Subject: [PATCH 2/2] Added fix for sidekiq --- Capfile | 5 +++-- Gemfile | 1 + Gemfile.lock | 3 +++ config/deploy.rb | 9 +++++---- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Capfile b/Capfile index 079c16d83..9af9fcea9 100644 --- a/Capfile +++ b/Capfile @@ -40,11 +40,12 @@ require "capistrano/rails/migrations" require "capistrano/passenger" require 'capistrano/maintenance' require 'whenever/capistrano' -require 'capistrano/sidekiq' - +#require 'capistrano/sidekiq' +set :services, [:sidekiq_pp] +require 'capistrano/service' diff --git a/Gemfile b/Gemfile index 51f710a9c..17f99bd82 100644 --- a/Gemfile +++ b/Gemfile @@ -45,6 +45,7 @@ group :development do gem 'capistrano-passenger', '0.2.0', require: false gem 'capistrano-sidekiq','1.0.2' gem 'capistrano-git-with-submodules', '2.0.3' + gem 'capistrano-service' # gem 'listen', '~> 3.1.5' # gem 'spring-watcher-listen', '~> 2.0.0' # diff --git a/Gemfile.lock b/Gemfile.lock index 4fe0be0f0..9d6178dae 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -794,6 +794,8 @@ GEM capistrano-rvm (0.1.2) capistrano (~> 3.0) sshkit (~> 1.2) + capistrano-service (0.0.2) + capistrano (>= 3.0.0.pre) capistrano-sidekiq (1.0.2) capistrano (>= 3.9.0) sidekiq (>= 3.4) @@ -1128,6 +1130,7 @@ DEPENDENCIES capistrano-passenger (= 0.2.0) capistrano-rails (= 1.4.0) capistrano-rvm (= 0.1.2) + capistrano-service capistrano-sidekiq (= 1.0.2) capybara (~> 2.3.0) coffee-rails (~> 4.2.2) diff --git a/config/deploy.rb b/config/deploy.rb index fbe33ba34..19ef672fb 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -4,10 +4,6 @@ set :application, 'ProtectedPlanet' set :repo_url, 'git@github.com:unepwcmc/ProtectedPlanet.git' -set :init_system, :systemd -set :service_unit_name, "sidekiq_pp.service" -set :service_unit_name, "sidekiq_import_pp.service" - set :deploy_user, 'wcmc' set :deploy_to, "/home/#{fetch(:deploy_user)}/#{fetch(:application)}" @@ -32,3 +28,8 @@ set :keep_releases, 5 set :passenger_restart_with_touch, false + + +namespace :deploy do + after :publishing, 'service:sidekiq_pp:restart' +end