From 223e5f1e81d97748312d2838c9cd2bcd12318578 Mon Sep 17 00:00:00 2001 From: evazion Date: Wed, 7 Aug 2019 22:11:07 -0500 Subject: [PATCH] capistrano: enable conditional migrations. --- config/deploy.rb | 8 +++++++- config/deploy/production.rb | 8 ++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/config/deploy.rb b/config/deploy.rb index 1ddc09a64..88cebd9fd 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -4,5 +4,11 @@ set :application, "danbooru" set :repo_url, "git://github.com/r888888888/danbooru.git" set :deploy_to, "/var/www/danbooru2" set :rbenv_ruby, "2.5.1" -set :linked_dirs, fetch(:linked_dirs, []).push('log', 'tmp/pids', 'tmp/cache', 'tmp/sockets', 'vendor/bundle') +append :linked_dirs, "log", "tmp/pids", "tmp/cache", "tmp/sockets", "vendor/bundle" set :branch, ENV.fetch("branch", "master") + +# skip migrations if files in db/migrate weren't modified +set :conditionally_migrate, true + +# run migrations on the primary app server +set :migration_role, :app diff --git a/config/deploy/production.rb b/config/deploy/production.rb index f12369c93..62ccddb58 100644 --- a/config/deploy/production.rb +++ b/config/deploy/production.rb @@ -1,11 +1,11 @@ set :user, "danbooru" set :rails_env, "production" -server "kagamihara", :roles => %w(web app db), :primary => true +set :rbenv_path, "/home/danbooru/.rbenv" +append :linked_files, ".env.production" + +server "kagamihara", :roles => %w(web app), :primary => true server "shima", :roles => %w(web app) server "saitou", :roles => %w(web app) server "oogaki", :roles => %w(worker) -set :linked_files, fetch(:linked_files, []).push(".env.production") -set :rbenv_path, "/home/danbooru/.rbenv" - after "deploy:finished", "newrelic:notice_deployment"