From 0f0b9dac1bfb22a2081a3b1e38a72c7551c067c9 Mon Sep 17 00:00:00 2001 From: Varun Rao Date: Tue, 29 Jun 2021 17:41:02 -0700 Subject: [PATCH 1/2] Use ruby greater than 2.6 --- .ruby-version | 2 +- bin/codedeploy-agent | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.ruby-version b/.ruby-version index bc4abe86..e70b4523 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.3.8 +2.6.0 diff --git a/bin/codedeploy-agent b/bin/codedeploy-agent index 6e7d4a4b..87daeb33 100755 --- a/bin/codedeploy-agent +++ b/bin/codedeploy-agent @@ -2,7 +2,7 @@ $:.unshift File.join(File.dirname(File.expand_path('..', __FILE__)), 'lib') -ruby_versions = ["2.7", "2.6", "2.5", "2.4", "2.3", "2.2", "2.1", "2.0"] +ruby_versions = ["2.7", "2.6"] actual_ruby_version = RUBY_VERSION.split('.').map{|s|s.to_i} left_bound = '2.0.0'.split('.').map{|s|s.to_i} ruby_bin = nil From dcc4c439739e0b3f7cbb114385e5bef2d9236e93 Mon Sep 17 00:00:00 2001 From: Varun Rao Date: Tue, 29 Jun 2021 17:53:10 -0700 Subject: [PATCH 2/2] Correct error message and left_bound to reflect 2.6 has lowest version --- bin/codedeploy-agent | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/codedeploy-agent b/bin/codedeploy-agent index 87daeb33..70203e2b 100755 --- a/bin/codedeploy-agent +++ b/bin/codedeploy-agent @@ -4,7 +4,7 @@ $:.unshift File.join(File.dirname(File.expand_path('..', __FILE__)), 'lib') ruby_versions = ["2.7", "2.6"] actual_ruby_version = RUBY_VERSION.split('.').map{|s|s.to_i} -left_bound = '2.0.0'.split('.').map{|s|s.to_i} +left_bound = '2.6.0'.split('.').map{|s|s.to_i} ruby_bin = nil if (actual_ruby_version <=> left_bound) > -1 @@ -23,5 +23,5 @@ if ruby_bin exec("#{ruby_bin} #{File.join(File.expand_path(File.dirname(__FILE__)), "../lib/codedeploy-agent.rb")} #{ARGV.join(' ')}") end -STDERR.puts "No supported ruby version found. Code Deploy Host Agent supports Ruby version 2.0.x and greater." +STDERR.puts "No supported ruby version found. Code Deploy Host Agent supports Ruby version 2.6.x and greater." exit(1)