Skip to content

Instantly share code, notes, and snippets.

@pecha7x
Created August 3, 2022 09:50
Show Gist options
  • Save pecha7x/48b091d0ea3516b5e85cfab0dcc1d22b to your computer and use it in GitHub Desktop.
Save pecha7x/48b091d0ea3516b5e85cfab0dcc1d22b to your computer and use it in GitHub Desktop.
set :stage, :production
set :rails_env, 'production'
set :branch, 'master'
server '54.206.28.69',
user: 'deploy',
roles: %w(app web db nginx),
foreman_options: { concurrency: 'web=1' },
puma_options: { workers: 8 }
server '52.62.123.156',
user: 'deploy',
roles: %w(app web sidekiq),
foreman_options: { concurrency: 'web=1,sidekiq=1' },
puma_options: {
bind: 'tcp://172.31.42.41:9292',
workers: 16
}
server '52.64.8.240',
user: 'deploy',
roles: %w(app production_cron),
foreman_options: { concurrency:
['worker_extra=14',
'worker_fitware=1',
'worker_mindbody_sync=1',
'worker_mindbody_download=1',
'worker_jonas_sync=1',
'worker_bulk_action=2',
'worker_full_contact=1',
'worker_mailer=1',
'worker_report_mailer=1',
'worker_export=1',
'worker_default=1',
'worker_abcfin_sync=18',
'sidekiq=4',
'worker_asf_sync=1',
'worker_sync=5',
'worker_perkville_sync=1'].join(',') }
set :assets_roles, %w(web app)
set :puma_threads, [5, 5]
namespace :deploy do
desc 'Restart the application services'
task :restart do
on roles(:production_cron) do
sudo 'service gymsales restart'
end
on roles(:sidekiq) do
within release_path do
execute :bundle, 'exec sidekiqctl quiet', 'tmp/pids/sidekiq.pid'
end
end
on roles(:web) do
if fetch(:force_restart, true)
sudo 'service gymsales restart'
else
execute "(kill -s SIGUSR1 $(ps -C ruby -F | grep 'puma 3' | awk {'print $2'})) || /usr/bin/env sudo service gymsales restart"
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment