From 3e83152270fa5218ff9cea74e642f1cf92e6a52a Mon Sep 17 00:00:00 2001 From: jfarrell Date: Wed, 6 May 2020 14:45:59 -0400 Subject: [PATCH 1/2] Update to require ruby2.5+ --- .gitignore | 5 ++++- .ruby-version | 2 +- .travis.yml | 22 ++++++++++++++++------ Dockerfile | 18 ++++++++++++++++++ Gemfile | 1 - README.md | 2 +- moonshot.gemspec | 7 +++++-- 7 files changed, 45 insertions(+), 12 deletions(-) create mode 100644 Dockerfile diff --git a/.gitignore b/.gitignore index 926950e2..816dd2a1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,8 @@ +/moonshot-*.gem +/.bundle /Gemfile.lock /vendor /coverage +/cc-test-reporter site/ -sample/gems \ No newline at end of file +sample/gems diff --git a/.ruby-version b/.ruby-version index 6b4d1577..95e3ba81 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.2.3 \ No newline at end of file +2.5 diff --git a/.travis.yml b/.travis.yml index ff6583bd..e448693a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,11 +2,11 @@ language: ruby cache: bundler -# This will enable the container-based infrastructure for -# travis tests. It should result in faster test vm load times. -# @see http://docs.travis-ci.com/user/workers/container-based-infrastructure/ sudo: false +rvm: + - 2.5 + addons: apt: sources: @@ -14,10 +14,20 @@ addons: packages: - cmake +env: + global: + - COVERAGE=1 + before_install: - gem install rubygems-update -v '<3' --no-document && update_rubygems - gem update bundler -rvm: - - 2.2 - - 2.3.3 +before_script: + - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter + - chmod +x ./cc-test-reporter + - ./cc-test-reporter before-build + +after_script: + - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT + - ./cc-test-reporter format-coverage -t simplecov -o coverage/codeclimate.json coverage/.resultset.json + - if [[ "$TRAVIS_TEST_RESULT" == 0 ]]; then ./cc-test-reporter upload-coverage -i coverage/codeclimate.json; fi diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..0cbc6959 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,18 @@ +FROM ubuntu:xenial + +RUN apt-get update \ + && apt-get install -y \ + build-essential \ + cmake \ + git \ + software-properties-common + +RUN apt-add-repository -y ppa:brightbox/ruby-ng \ + && apt-get update \ + && apt-get install -y \ + ruby2.6 \ + ruby2.6-dev + +RUN gem install rubygems-update -v '<3' --no-document && update_rubygems \ + && gem update bundler + diff --git a/Gemfile b/Gemfile index 43bb6d2d..f91427d3 100644 --- a/Gemfile +++ b/Gemfile @@ -5,7 +5,6 @@ gemspec gem 'rake', require: false group :test do - gem 'codeclimate-test-reporter' gem 'pry' gem 'rubocop', '~> 0.49.0' end diff --git a/README.md b/README.md index 2356b7a6..872593ed 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ We also want to [help you contribute and answer all your questions](http://moons ## Requirements -- Ruby 2.2 or higher +- Ruby 2.5 or higher ## Attributions diff --git a/moonshot.gemspec b/moonshot.gemspec index b7d75f66..7e5ad2c1 100644 --- a/moonshot.gemspec +++ b/moonshot.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |s| s.name = 'moonshot' - s.version = '2.0.0.beta6' + s.version = '2.1.0.beta1' s.licenses = ['Apache-2.0'] s.summary = 'A library and CLI tool for launching services into AWS' s.description = 'A library and CLI tool for launching services into AWS.' @@ -37,7 +37,10 @@ Gem::Specification.new do |s| s.add_dependency('require_all', '~> 1.5.0') s.add_development_dependency('rspec') - s.add_development_dependency('simplecov') + # Workaround for cc-test-reporter with SimpleCov 0.18. + # Stop upgrading SimpleCov until the following issue will be resolved. + # https://github.com/codeclimate/test-reporter/issues/418 + s.add_development_dependency('simplecov', '~> 0.17.1') # fakefs requires < 0.14.0 for ruby 2.2 s.add_development_dependency('fakefs', '< 0.14.0') end From 39d394ff0d74d2828f6dc31a360af4e41c57a05c Mon Sep 17 00:00:00 2001 From: jfarrell Date: Tue, 24 Nov 2020 15:49:01 -0500 Subject: [PATCH 2/2] Update to require ruby2.6+ --- .ruby-version | 2 +- .travis.yml | 2 +- Gemfile | 2 +- moonshot.gemspec | 23 ++++++++--------------- spec/moonshot/stack_spec.rb | 6 +++--- 5 files changed, 14 insertions(+), 21 deletions(-) diff --git a/.ruby-version b/.ruby-version index 95e3ba81..5154b3f6 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.5 +2.6 diff --git a/.travis.yml b/.travis.yml index e448693a..a5ab1540 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,7 @@ cache: bundler sudo: false rvm: - - 2.5 + - 2.6 addons: apt: diff --git a/Gemfile b/Gemfile index f91427d3..bddf882a 100644 --- a/Gemfile +++ b/Gemfile @@ -6,5 +6,5 @@ gem 'rake', require: false group :test do gem 'pry' - gem 'rubocop', '~> 0.49.0' + gem 'rubocop' end diff --git a/moonshot.gemspec b/moonshot.gemspec index 7e5ad2c1..2e2e5691 100644 --- a/moonshot.gemspec +++ b/moonshot.gemspec @@ -21,26 +21,19 @@ Gem::Specification.new do |s| s.add_dependency('aws-sdk-s3', '~> 1.12') s.add_dependency('colorize') - s.add_dependency('highline', '~> 1.7.2') - s.add_dependency('interactive-logger', '~> 0.1.2') - s.add_dependency('rotp', '~> 2.1.1') - s.add_dependency('ruby-duration', '~> 3.2.3') + s.add_dependency('highline') + s.add_dependency('interactive-logger') + s.add_dependency('rotp') + s.add_dependency('ruby-duration') s.add_dependency('retriable') - # Pin back activesupport (ruby-duration dependency) until we only support - # Ruby >= 2.2.2. - s.add_dependency('activesupport', '< 5.0.0') - s.add_dependency('thor', '~> 0.19.1') + s.add_dependency('activesupport') + s.add_dependency('thor') s.add_dependency('semantic') s.add_dependency('travis') s.add_dependency('vandamme') s.add_dependency('pry') s.add_dependency('require_all', '~> 1.5.0') - s.add_development_dependency('rspec') - # Workaround for cc-test-reporter with SimpleCov 0.18. - # Stop upgrading SimpleCov until the following issue will be resolved. - # https://github.com/codeclimate/test-reporter/issues/418 - s.add_development_dependency('simplecov', '~> 0.17.1') - # fakefs requires < 0.14.0 for ruby 2.2 - s.add_development_dependency('fakefs', '< 0.14.0') + s.add_development_dependency('simplecov') + s.add_development_dependency('fakefs') end diff --git a/spec/moonshot/stack_spec.rb b/spec/moonshot/stack_spec.rb index 7d8a0cfe..f075505b 100644 --- a/spec/moonshot/stack_spec.rb +++ b/spec/moonshot/stack_spec.rb @@ -105,20 +105,20 @@ let(:expected_put_object_options) do { bucket: config.template_s3_bucket, - key: 'rspec-app-staging-1483228800-template.yml', + key: 'rspec-app-staging-1483246800-template.yml', body: an_instance_of(String) } end let(:expected_create_stack_options) do { - template_url: 'http://rspec-bucket.s3.amazonaws.com/rspec-app-staging-1483228800-template.yml' + template_url: 'http://rspec-bucket.s3.amazonaws.com/rspec-app-staging-1483246800-template.yml' } end it 'should call put_object and create_stack with template_url parameter' do expect(s3_client).to receive(:put_object) - .with(hash_including(expected_put_object_options)) + .with(expected_put_object_options) expect(cf_client).to receive(:create_stack) .with(hash_including(expected_create_stack_options)) subject.create