From a348d95057112d120885542f5b95e26f3566e0a9 Mon Sep 17 00:00:00 2001 From: gregoirenovel Date: Wed, 31 May 2017 17:03:51 +0200 Subject: [PATCH 1/3] [Fix #77] Staging is dead => change the CI and deploy info Use develop instead --- .circleci/config.yml | 2 +- config/deploy.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 90725ad32..45417e72c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -64,7 +64,7 @@ jobs: - "0a:67:42:7d:7e:b7:e1:3c:48:8f:bf:68:10:51:a8:44" - deploy: command: | - if [ "${CIRCLE_BRANCH}" == "staging" ]; then + if [ "${CIRCLE_BRANCH}" == "develop" ]; then bundle exec rake deploy_ha fi diff --git a/config/deploy.rb b/config/deploy.rb index eae817ea8..68315835c 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -27,7 +27,7 @@ set :deploy_to, '/var/www/tps_dev' case ENV["to"] when "staging" if ENV['branch'].nil? - set :branch, 'staging' + set :branch, 'develop' else set :branch, ENV['branch'] end From 46c0e04b0c7a5f4442e4a091512811bff637c963 Mon Sep 17 00:00:00 2001 From: Mathieu Magnin Date: Wed, 31 May 2017 17:22:30 +0200 Subject: [PATCH 2/3] Save 8 lines of code --- config/deploy.rb | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/config/deploy.rb b/config/deploy.rb index 68315835c..24bcfe12e 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -26,20 +26,12 @@ set :deploy_to, '/var/www/tps_dev' case ENV["to"] when "staging" - if ENV['branch'].nil? - set :branch, 'develop' - else - set :branch, ENV['branch'] - end + set :branch, ENV['branch'] || 'develop' set :deploy_to, '/var/www/tps_dev' set :user, 'tps_dev' # Username in the server to SSH to. appname = 'tps_dev' when "production" - if ENV['branch'].nil? - set :branch, 'master' - else - set :branch, ENV['branch'] - end + set :branch, ENV['branch'] || 'master' set :deploy_to, '/var/www/tps' set :user, 'tps' # Username in the server to SSH to. appname = 'tps' From a7969e550782764d38fe3530502144f619bcb051 Mon Sep 17 00:00:00 2001 From: Mathieu Magnin Date: Wed, 31 May 2017 17:24:16 +0200 Subject: [PATCH 3/3] Branch value in log is now correct --- config/deploy.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config/deploy.rb b/config/deploy.rb index 24bcfe12e..ef1d6b4e1 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -15,7 +15,6 @@ raise "Bad to=#{+ENV['to']}" unless ["staging", "production"].include?(ENV['to'] raise "missing domain, run with 'rake deploy domain=37.187.154.237'" if ENV['domain'].nil? -print "Deploy to #{ENV['to']} environment branch #{branch}\n" # set :domain, '5.135.190.60' set :domain, ENV['domain'] @@ -37,6 +36,8 @@ when "production" appname = 'tps' end +print "Deploy to #{ENV['to']} environment branch #{branch}\n" + set :rails_env, ENV["to"] # For system-wide RVM install.