demarches-normaliennes/lib/tasks/deploy.rake
mfo 02590b3a73
Revert "clean(delayed_jobs): remove dependencies and all occurences"
This reverts commit 90ca937b7131575816d72e35e2c48f9d82e9a5e6.

ReRevert me in order to remove all delayed job occurences. But we keep
this dependencie for our instances at least for a year
2024-10-08 16:44:09 +02:00

42 lines
926 B
Ruby

# frozen_string_literal: true
def domains_for_stage
if ENV['DOMAINS'].present?
ENV['DOMAINS'].split
else
raise "DOMAINS is empty. It must be something like DOMAINS='web1.dev web2.dev'"
end
end
task :setup do
domains = domains_for_stage
domains.each do |domain|
sh "mina setup domain=#{domain}"
end
end
task :deploy do
domains = domains_for_stage
branch = ENV.fetch('BRANCH')
domains.each do |domain|
sh "mina deploy domain=#{domain} branch=#{branch} force_asset_precompile=true"
end
end
task :post_deploy do
domains = domains_for_stage
branch = ENV.fetch('BRANCH')
sh "mina post_deploy domain=#{domains.first} branch=#{branch}"
end
task :rollback do
domains = domains_for_stage
branch = ENV.fetch('BRANCH')
domains.each do |domain|
sh "mina rollback service:restart_puma service:reload_nginx service:restart_delayed_job domain=#{domain} branch=#{branch}"
end
end