Files
grecia/Capfile
Javi Martín d8d4c1e9a4 Use systemd to start and monitor puma
Puma 4 is no longer maintained, and Puma 5 removed the option to run
Puma as as daemon. That means that, in order to upgrade, we need to rely
in a process monitoring tool. We're using systemd because it's installed
by default in most (all?) operating systems running Consul Democracy on
production and it's supported by both Puma and the capistrano3-puma gem.

Using systemd means Puma will be automatically started whenever it
crashes, so we no longer need the changes done in commit 40b3c9f2c and
we can now use the default tasks configuration in capistrano3-puma and
capistrano3-delayed-job.

Since Puma is also started automatically when booting the system, we
don't need a cron job to do so anymore and can remove it from the
`schedule.rb` file.
2023-10-24 23:00:12 +02:00

28 lines
817 B
Ruby

# Load DSL and set up stages
require "capistrano/setup"
# Include default deployment tasks
require "capistrano/deploy"
require "capistrano/bundler"
require "capistrano/npm"
require "capistrano/rails/assets"
require "capistrano/rails/migrations"
#require "capistrano/passenger"
require "capistrano/delayed_job"
require "whenever/capistrano"
require "rvm1/capistrano3"
require "capistrano/puma"
install_plugin Capistrano::Puma, load_hooks: false
install_plugin Capistrano::Puma::Systemd
#SCM: Git
require "capistrano/scm/git"
install_plugin Capistrano::SCM::Git
# Load custom tasks from `lib/capistrano/tasks` if you have any defined
Dir.glob("lib/capistrano/tasks/*.rake").each { |r| import r }
Dir.glob("lib/capistrano/tasks/*.cap").each { |r| import r }
Dir.glob("lib/capistrano/**/*.rb").each { |r| import r }