From c445de9f83ad1229218fea10eada79ef7ec81fc0 Mon Sep 17 00:00:00 2001 From: gregoirenovel Date: Thu, 20 Sep 2018 11:34:59 +0200 Subject: [PATCH] Regroup definitions at the top of deploy.rb --- config/deploy.rb | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/config/deploy.rb b/config/deploy.rb index eafd61382..d3dca9ca5 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -20,23 +20,9 @@ end set :domain, ENV['domain'] set :repository, 'https://github.com/betagouv/tps.git' set :port, 2200 - -case ENV["to"] -when "staging" - set :branch, ENV['branch'] || 'dev' - set :deploy_to, '/var/www/tps_dev' - set :user, 'tps_dev' # Username in the server to SSH to. - appname = 'tps_dev' -when "production" - set :branch, ENV['branch'] || 'master' - set :deploy_to, '/var/www/tps' - set :user, 'tps' # Username in the server to SSH to. - appname = 'tps' -end - -print "Deploy to #{ENV['to']} environment branch #{branch}\n" - set :rails_env, 'production' +set :rbenv_path, "/usr/local/rbenv/bin/rbenv" +set :forward_agent, true # SSH forward_agent. # Manually create these paths in shared/ (eg: shared/config/database.yml) in your server. # They will be linked in the 'deploy:link_shared_paths' step. @@ -52,9 +38,20 @@ set :shared_paths, [ 'config/unicorn.rb' ] -set :rbenv_path, "/usr/local/rbenv/bin/rbenv" +case ENV["to"] +when "staging" + set :branch, ENV['branch'] || 'dev' + set :deploy_to, '/var/www/tps_dev' + set :user, 'tps_dev' # Username in the server to SSH to. + appname = 'tps_dev' +when "production" + set :branch, ENV['branch'] || 'master' + set :deploy_to, '/var/www/tps' + set :user, 'tps' # Username in the server to SSH to. + appname = 'tps' +end -set :forward_agent, true # SSH forward_agent. +print "Deploy to #{ENV['to']} environment branch #{branch}\n" # This task is the environment that is loaded for most commands, such as # `mina deploy` or `mina rake`.