Merge pull request #6031 from betagouv/fix_deployment

Répare le déploiement (maj mimemagic et test du fichier i_am_a_webserver)
This commit is contained in:
LeSim 2021-03-29 18:55:48 +02:00 committed by GitHub
commit edbb5c325d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 6 deletions

View file

@ -199,9 +199,6 @@ GEM
database_cleaner-core (2.0.1)
datetime_picker_rails (0.0.7)
momentjs-rails (>= 2.8.1)
debase (2.3.2)
debase-ruby_core_source (~> 0.10.11)
debase-ruby_core_source (0.10.12)
deep_cloneable (3.0.0)
activerecord (>= 3.1.0, < 7)
delayed_cron_job (0.7.4)
@ -421,7 +418,9 @@ GEM
mime-types (3.3.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2021.0212)
mimemagic (0.3.5)
mimemagic (0.3.10)
nokogiri (~> 1)
rake
mini_magick (4.11.0)
mini_mime (1.0.2)
mini_portile2 (2.5.0)

View file

@ -4,6 +4,7 @@ require 'mina/rails'
require 'mina/rbenv'
SHARED_WORKER_FILE_NAME = 'i_am_a_worker'
SHARED_WEBSERVER_FILE_NAME = 'i_am_a_webserver'
# Basic settings:
# domain - The hostname to SSH to.
# deploy_to - Path to deploy into.
@ -80,17 +81,21 @@ end
namespace :service do
desc "Restart puma"
task :restart_puma do
webserver_file_path = File.join(deploy_to, 'shared', SHARED_WEBSERVER_FILE_NAME)
command %{
echo "-----> Restarting puma service"
#{echo_cmd %[sudo systemctl restart puma]}
#{echo_cmd %[test -f #{webserver_file_path} && sudo systemctl restart puma]}
}
end
desc "Reload nginx"
task :reload_nginx do
webserver_file_path = File.join(deploy_to, 'shared', SHARED_WEBSERVER_FILE_NAME)
command %{
echo "-----> Reloading nginx service"
#{echo_cmd %[sudo systemctl reload nginx]}
#{echo_cmd %[test -f #{webserver_file_path} && sudo systemctl reload nginx]}
}
end