From 9bd41a3408890b45b748ce3c5b2bf1b50dfe9580 Mon Sep 17 00:00:00 2001 From: Taku Nakajima Date: Mon, 23 May 2022 15:13:07 +0900 Subject: [PATCH 1/4] Upgrade ruby in itamae_plugin --- .ruby-version | 1 + lib/barcelona/plugins/itamae_plugin.rb | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 .ruby-version diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 00000000..57cf282e --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +2.6.5 diff --git a/lib/barcelona/plugins/itamae_plugin.rb b/lib/barcelona/plugins/itamae_plugin.rb index b814faac..fa668b0b 100644 --- a/lib/barcelona/plugins/itamae_plugin.rb +++ b/lib/barcelona/plugins/itamae_plugin.rb @@ -30,7 +30,7 @@ def install_itamae(user_data) redhat-rpm-config ) user_data.run_commands += <<~EOS.split("\n") - amazon-linux-extras install ruby2.4 + amazon-linux-extras install ruby2.6 yum install -y ruby-devel gem install itamae -v '1.10.6' -N gem install io-console -N From a5f8ee5e4f20323ec6d181f5870bc7dd3401cb70 Mon Sep 17 00:00:00 2001 From: Taku Nakajima Date: Mon, 23 May 2022 15:22:31 +0900 Subject: [PATCH 2/4] Upgrade rails and nokogiri --- Gemfile | 2 +- Gemfile.lock | 114 +++++++++++++++++++++++++-------------------------- 2 files changed, 56 insertions(+), 60 deletions(-) diff --git a/Gemfile b/Gemfile index 1d3128a8..4098e82c 100644 --- a/Gemfile +++ b/Gemfile @@ -23,7 +23,7 @@ gem 'octokit' gem 'pg' gem 'puma' gem 'pundit' -gem 'rails', '~> 5.2.4.6' +gem 'rails', '~> 5.2.7.1' gem 'sqlite3' gem 'thor', require: false gem 'vault' diff --git a/Gemfile.lock b/Gemfile.lock index 1072579b..0342e9b7 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,25 +1,25 @@ GEM remote: https://rubygems.org/ specs: - actioncable (5.2.4.6) - actionpack (= 5.2.4.6) + actioncable (5.2.7.1) + actionpack (= 5.2.7.1) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailer (5.2.4.6) - actionpack (= 5.2.4.6) - actionview (= 5.2.4.6) - activejob (= 5.2.4.6) + actionmailer (5.2.7.1) + actionpack (= 5.2.7.1) + actionview (= 5.2.7.1) + activejob (= 5.2.7.1) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) - actionpack (5.2.4.6) - actionview (= 5.2.4.6) - activesupport (= 5.2.4.6) + actionpack (5.2.7.1) + actionview (= 5.2.7.1) + activesupport (= 5.2.7.1) rack (~> 2.0, >= 2.0.8) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.2) - actionview (5.2.4.6) - activesupport (= 5.2.4.6) + actionview (5.2.7.1) + activesupport (= 5.2.7.1) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) @@ -29,20 +29,20 @@ GEM activemodel (>= 4.1, < 6) case_transform (>= 0.2) jsonapi-renderer (>= 0.1.1.beta1, < 0.3) - activejob (5.2.4.6) - activesupport (= 5.2.4.6) + activejob (5.2.7.1) + activesupport (= 5.2.7.1) globalid (>= 0.3.6) - activemodel (5.2.4.6) - activesupport (= 5.2.4.6) - activerecord (5.2.4.6) - activemodel (= 5.2.4.6) - activesupport (= 5.2.4.6) + activemodel (5.2.7.1) + activesupport (= 5.2.7.1) + activerecord (5.2.7.1) + activemodel (= 5.2.7.1) + activesupport (= 5.2.7.1) arel (>= 9.0) - activestorage (5.2.4.6) - actionpack (= 5.2.4.6) - activerecord (= 5.2.4.6) - marcel (~> 0.3.1) - activesupport (5.2.4.6) + activestorage (5.2.7.1) + actionpack (= 5.2.7.1) + activerecord (= 5.2.7.1) + marcel (~> 1.0.0) + activesupport (5.2.7.1) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 0.7, < 2) minitest (~> 5.1) @@ -107,7 +107,7 @@ GEM case_transform (0.2) activesupport coderay (1.1.2) - concurrent-ruby (1.1.8) + concurrent-ruby (1.1.10) crack (0.4.3) safe_yaml (~> 1.0.0) crass (1.0.6) @@ -147,11 +147,11 @@ GEM faraday-patron (1.0.0) faraday-rack (1.0.0) gibberish (2.1.0) - globalid (0.4.2) - activesupport (>= 4.2.0) + globalid (1.0.0) + activesupport (>= 5.0) hashdiff (0.3.8) honeybadger (4.7.2) - i18n (1.8.10) + i18n (1.10.0) concurrent-ruby (~> 1.0) jaro_winkler (1.5.4) jbuilder (2.8.0) @@ -164,26 +164,22 @@ GEM activesupport (>= 4) railties (>= 4) request_store (~> 1.0) - loofah (2.9.1) + loofah (2.18.0) crass (~> 1.0.2) nokogiri (>= 1.5.9) mail (2.7.1) mini_mime (>= 0.1.1) - marcel (0.3.3) - mimemagic (~> 0.3.2) + marcel (1.0.2) maruku (0.7.3) method_source (0.9.2) - mimemagic (0.3.10) - nokogiri (~> 1) - rake - mini_mime (1.1.0) + mini_mime (1.1.2) mini_portile2 (2.8.0) - minitest (5.14.4) + minitest (5.15.0) multi_json (1.13.1) multipart-post (2.1.1) net-ssh (5.2.0) nio4r (2.5.8) - nokogiri (1.13.4) + nokogiri (1.13.6) mini_portile2 (~> 2.8.0) racc (~> 1.4) octokit (4.21.0) @@ -210,32 +206,32 @@ GEM rack (2.2.3) rack-test (1.1.0) rack (>= 1.0, < 3) - rails (5.2.4.6) - actioncable (= 5.2.4.6) - actionmailer (= 5.2.4.6) - actionpack (= 5.2.4.6) - actionview (= 5.2.4.6) - activejob (= 5.2.4.6) - activemodel (= 5.2.4.6) - activerecord (= 5.2.4.6) - activestorage (= 5.2.4.6) - activesupport (= 5.2.4.6) + rails (5.2.7.1) + actioncable (= 5.2.7.1) + actionmailer (= 5.2.7.1) + actionpack (= 5.2.7.1) + actionview (= 5.2.7.1) + activejob (= 5.2.7.1) + activemodel (= 5.2.7.1) + activerecord (= 5.2.7.1) + activestorage (= 5.2.7.1) + activesupport (= 5.2.7.1) bundler (>= 1.3.0) - railties (= 5.2.4.6) + railties (= 5.2.7.1) sprockets-rails (>= 2.0.0) rails-dom-testing (2.0.3) activesupport (>= 4.2.0) nokogiri (>= 1.6) - rails-html-sanitizer (1.3.0) + rails-html-sanitizer (1.4.2) loofah (~> 2.3) - railties (5.2.4.6) - actionpack (= 5.2.4.6) - activesupport (= 5.2.4.6) + railties (5.2.7.1) + actionpack (= 5.2.7.1) + activesupport (= 5.2.7.1) method_source rake (>= 0.8.7) thor (>= 0.19.0, < 2.0) rainbow (3.0.0) - rake (13.0.3) + rake (13.0.6) regexp_parser (1.7.1) request_store (1.4.1) rack (>= 1.4) @@ -307,17 +303,17 @@ GEM activesupport (>= 4.2) spring-commands-rspec (1.0.4) spring (>= 0.9.1) - sprockets (4.0.2) + sprockets (4.0.3) concurrent-ruby (~> 1.0) rack (> 1, < 3) - sprockets-rails (3.2.2) - actionpack (>= 4.0) - activesupport (>= 4.0) + sprockets-rails (3.4.2) + actionpack (>= 5.2) + activesupport (>= 5.2) sprockets (>= 3.0.0) sqlite3 (1.4.0) stub_env (1.0.4) rspec (>= 2.0, < 4.0) - thor (1.1.0) + thor (1.2.1) thread_safe (0.3.6) tilt (2.0.10) tzinfo (1.2.9) @@ -329,7 +325,7 @@ GEM addressable (>= 2.3.6) crack (>= 0.3.2) hashdiff - websocket-driver (0.7.3) + websocket-driver (0.7.5) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) yard (0.9.25) @@ -366,7 +362,7 @@ DEPENDENCIES puma pundit rack-test - rails (~> 5.2.4.6) + rails (~> 5.2.7.1) rspec-collection_matchers rspec-its rspec-rails From 8b6e78e15c7cae27fa2a6a68df651c198c258baa Mon Sep 17 00:00:00 2001 From: Taku Nakajima Date: Mon, 23 May 2022 15:41:04 +0900 Subject: [PATCH 3/4] Remove .ruby-version --- .ruby-version | 1 - 1 file changed, 1 deletion(-) delete mode 100644 .ruby-version diff --git a/.ruby-version b/.ruby-version deleted file mode 100644 index 57cf282e..00000000 --- a/.ruby-version +++ /dev/null @@ -1 +0,0 @@ -2.6.5 From 9a8bd510424ac8c525ef39b0f1e90ed5691097ad Mon Sep 17 00:00:00 2001 From: David Siaw Date: Tue, 24 May 2022 13:47:17 +0900 Subject: [PATCH 4/4] add check to see if attribute is set --- lib/barcelona/plugins/itamae_plugin.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/barcelona/plugins/itamae_plugin.rb b/lib/barcelona/plugins/itamae_plugin.rb index fa668b0b..12b40869 100644 --- a/lib/barcelona/plugins/itamae_plugin.rb +++ b/lib/barcelona/plugins/itamae_plugin.rb @@ -14,8 +14,10 @@ def on_container_instance_user_data(_instance, user_data) def on_network_stack_template(_stack, template) bastion_lc = template["BastionLaunchConfiguration"] return template if bastion_lc.nil? + return template unless attributes['recipe_url'] =~ URI::regexp user_data = InstanceUserData.load_or_initialize(bastion_lc["Properties"]["UserData"]) + install_itamae(user_data) apply_itamae_recipe(user_data, attributes['recipe_url'], 'barcelona_bastion') bastion_lc["Properties"]["UserData"] = user_data.build