From 19f8e3ac8eb42140fd8d5f31658764a260224387 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Fri, 21 Jun 2019 01:29:44 +0200 Subject: [PATCH 1/4] Enable tasks to install Ruby and bundler We're going to upgrade our ruby version, and we need these tasks. Note we now get a warning caused by `rvm1:install:ruby` invoking `deploy:updating`. It doesn't seem to be an issue because we don't add any hooks to `deploy:updating`, and neither do the rest of the gems we use. --- config/deploy.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config/deploy.rb b/config/deploy.rb index de562dc58..7f8cd2568 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -41,9 +41,9 @@ set(:config_files, %w[ set :whenever_roles, -> { :app } namespace :deploy do - #before :starting, "rvm1:install:rvm" # install/update RVM - #before :starting, "rvm1:install:ruby" # install Ruby and create gemset - #before :starting, "install_bundler_gem" # install bundler gem + before :starting, "rvm1:install:rvm" + before :starting, "rvm1:install:ruby" + before :starting, "install_bundler_gem" after "deploy:migrate", "add_new_settings" after :publishing, "deploy:restart" From 48dd4be85141bddf93cd93321097a6a1d685e3c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Tue, 2 Jul 2019 13:44:20 +0200 Subject: [PATCH 2/4] Use `.ruby-version` to detect our Ruby version Travis and Rubocop and rmv1-capistrano3 automatically detect the version based on the `.ruby-version` file. --- .rubocop_basic.yml | 1 - .travis.yml | 2 -- config/deploy.rb | 5 +++-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.rubocop_basic.yml b/.rubocop_basic.yml index ba3b32daa..42dfb1b20 100644 --- a/.rubocop_basic.yml +++ b/.rubocop_basic.yml @@ -9,7 +9,6 @@ AllCops: Exclude: - "db/migrate/**/*" - "db/schema.rb" - TargetRubyVersion: 2.3 # RuboCop has a bunch of cops enabled by default. This setting tells RuboCop # to ignore them, so only the ones explicitly set in this file are enabled. DisabledByDefault: true diff --git a/.travis.yml b/.travis.yml index faf764341..a6741da68 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,8 +2,6 @@ language: ruby addons: postgresql: "9.4" chrome: stable -rvm: -- 2.3.2 cache: bundler bundler_args: --without development before_script: diff --git a/config/deploy.rb b/config/deploy.rb index 7f8cd2568..1a558eacb 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -7,7 +7,6 @@ def deploysecret(key) end set :rails_env, fetch(:stage) -set :rvm1_ruby_version, "2.3.2" set :rvm1_map_bins, -> { fetch(:rvm_map_bins).to_a.concat(%w[rake gem bundle ruby]).uniq } set :application, "consul" @@ -63,7 +62,9 @@ end task :install_bundler_gem do on roles(:app) do - execute "rvm use #{fetch(:rvm1_ruby_version)}; gem install bundler" + within release_path do + execute "rvm use #{fetch(:rvm1_ruby_version)}; gem install bundler" + end end end From 41d252bf10e3973c3e1f406356ca19f832e397e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Wed, 3 Jul 2019 17:14:03 +0200 Subject: [PATCH 3/4] Simplify syntax to execute RMV We use `:rvm` just as we use `:rake` in other places. --- config/deploy.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/deploy.rb b/config/deploy.rb index 1a558eacb..21a0259ba 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -63,7 +63,7 @@ end task :install_bundler_gem do on roles(:app) do within release_path do - execute "rvm use #{fetch(:rvm1_ruby_version)}; gem install bundler" + execute :rvm, fetch(:rvm1_ruby_version), "do", "gem install bundler" end end end From a8331c956f4667a5ce3c516844157468fea3c3f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Wed, 3 Jul 2019 17:16:55 +0200 Subject: [PATCH 4/4] Upgrade to Ruby 2.4.6 Many gems have dropped support for Ruby 2.3, including Rails 6. We've already tested the upgrade on production environments; no issues so far. --- .ruby-version | 2 +- README.md | 2 +- README_ES.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.ruby-version b/.ruby-version index e7034819f..7bf4b6a8a 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.3.2 \ No newline at end of file +2.4.6 diff --git a/README.md b/README.md index 108974434..af080578d 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ You can access the main website of the project at [http://consulproject.org](htt **NOTE**: For more detailed instructions check the [docs](https://docs.consulproject.org) -Prerequisites: install git, Ruby 2.3.2, `bundler` gem, Node.js and PostgreSQL (>=9.4). +Prerequisites: install git, Ruby 2.4.6, `bundler` gem, Node.js and PostgreSQL (>=9.4). ```bash git clone https://github.com/consul/consul.git diff --git a/README_ES.md b/README_ES.md index 052b4ee85..2c6977062 100644 --- a/README_ES.md +++ b/README_ES.md @@ -36,7 +36,7 @@ Puedes acceder a la página principal del proyecto en [http://consulproject.org] **NOTA**: para unas instrucciones más detalladas consulta la [documentación](https://docs.consulproject.org) -Prerequisitos: tener instalado git, Ruby 2.3.2, la gema `bundler`, Node.js y PostgreSQL (9.4 o superior). +Prerequisitos: tener instalado git, Ruby 2.4.6, la gema `bundler`, Node.js y PostgreSQL (9.4 o superior). ```bash git clone https://github.com/consul/consul.git