From a751ce29c8abe1f27e10c8b53896c8cd9a6d7023 Mon Sep 17 00:00:00 2001 From: Aaron Lane Date: Sat, 1 Jul 2017 15:40:11 -0400 Subject: [PATCH] Fix Travis deployment stage (#123) * Update .travis.yml * Explicitly declare each unit stage * Skip install in depoy stage * Exclude vendor from RuboCop * Remove CodeClimate from older Ruby unit stages * Revert: Exclude vendor from RuboCop * Explicitly set RuboCop configuration file * Revert: Revert: Exclude vendor from RuboCop * Update Travis configuration - return unit stage to regular matrix - use default install command - test Terraform version 0.9.10 * Test preinstalled Ruby versions * Fix check on Ruby version in after_success * Use preinstall RubyGems version * Explicitly specify RuboCop configuration This should avoid configurations under `vendor/`. * Ignore `bin/` and `vendor/` in RuboCop * Skip unwanted, inherited steps * Replace `after_success` `skip` with `[]` `after_success` does not support `skip` --- .rubocop.yml | 3 ++- .travis.yml | 60 +++++++++++++++++++++++++++------------------------- 2 files changed, 33 insertions(+), 30 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 4d0452295..2aa4d1c2d 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -2,7 +2,8 @@ AllCops: DefaultFormatter: clang DisplayCopNames: true Exclude: - - bin/* + - bin/**/* + - vendor/**/* TargetRubyVersion: 2.2 Layout/IndentArray: Enabled: false diff --git a/.travis.yml b/.travis.yml index 67bf5877c..6760e50c3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,39 +4,38 @@ language: ruby env: global: secure: qq/9kGdMj8cDjH0cNxw9azwse/8oBduDxubAw1I22mUn8qqgQT1svndISfhfv9J8VPycLUaDdbHdUHD8l4tBlfZchAZvRSRIGJkMFSlt4wcEg0af9pqD502TUyLdYIyR+QGN0UAW7DznmcsjSn/3Ka2QB/aXjoBZKJYUXcGLYWIdDzsQQysI0bULHL5ztsL41DflXKj0MD+IKm3FhGpVfR931a3nG2A67pIPBTjtvUCAxcGDYB5VTPpTru9Z5CHM7zadSFD8uArV0s3OyAOuwM5bvVdtU6AlWR/PjoUjv6QZywJ+eMYowfpvmUeMehq5wpqtf0doTFMOvbveXVQ/2euwGxxuo5Q0awbzUtCBjV1ysqgy0SBfAfdOzNE8XaU2qiBFaDGITgEFU2TyEiLcxoEFjVRvHVLn0uijDoMZ8Go615tdiYZ/G9L5ltemov5D4W1Klhux49yEiYFD914XerX5y6d8oU6KsdJhun1WKETM7uweZz30MFZ9ixIUbeDbzvWwplIskR7PJWpCmfm59CQiOlZlHsvpDYygzQTGgY8yM9VgHH7LLDctAPpFi0A3uif6cC2KcTeJIuh+g7QRk7un5ycp86T9PnB+n4Yt6ahqHJMnztU3NyCAnY3elxCw5PkgL4a/7UwVIFYRgIkaEJl4JVqb4WhTNf9s7Vm52ek= -# REVIEW: https://www.ruby-lang.org/en/downloads/branches/ -rvm: - - 2.4.1 - - 2.3.4 - - 2.2.7 cache: - bundler -before_install: - - gem update --system - - gem --version -install: - - bundle install --jobs=3 --retry=3 - - bundle update --jobs=3 --retry=3 -script: +rvm: + - 2.4.0 + - 2.3.3 + - 2.2.6 +before_script: - bundle exec bundle-audit check --update +script: - bundle exec rspec - - bundle exec rubocop after_success: - - "[ $TRAVIS_RUBY_VERSION = '2.4.1' ] && bundle exec codeclimate-test-reporter" + - "[ $TRAVIS_RUBY_VERSION = '2.4.0' ] && bundle exec codeclimate-test-reporter" jobs: include: + - stage: style + before_script: skip + script: + - bundle exec rubocop --config=.rubocop.yml + after_success: [] - stage: integration sudo: required services: - docker env: - PATH="terraform:$PATH" - install: + before_install: - cd examples/docker_provider - - bundle install --jobs=3 --retry=3 --without=development - - bundle update --jobs=3 --retry=3 - - curl --output terraform.zip https://releases.hashicorp.com/terraform/0.9.8/terraform_0.9.8_linux_amd64.zip - - mkdir terraform && unzip terraform.zip -d terraform + - curl --output terraform.zip https://releases.hashicorp.com/terraform/0.9.10/terraform_0.9.10_linux_amd64.zip + - mkdir terraform + - unzip terraform.zip -d terraform + bundler_args: --without=development + before_script: skip script: - bundle exec kitchen test --log-level debug after_success: [] @@ -46,12 +45,13 @@ jobs: - docker env: - PATH="terraform:$PATH" - install: + before_install: - cd examples/docker_provider - - bundle install --jobs=3 --retry=3 --without=development - - bundle update --jobs=3 --retry=3 - curl --output terraform.zip https://releases.hashicorp.com/terraform/0.8.8/terraform_0.8.8_linux_amd64.zip - - mkdir terraform && unzip terraform.zip -d terraform + - mkdir terraform + - unzip terraform.zip -d terraform + bundler_args: --without=development + before_script: skip script: - bundle exec kitchen test --log-level debug after_success: [] @@ -61,18 +61,20 @@ jobs: - docker env: - PATH="terraform:$PATH" - install: + before_install: - cd examples/docker_provider - - bundle install --jobs=3 --retry=3 --without=development - - bundle update --jobs=3 --retry=3 - curl --output terraform.zip https://releases.hashicorp.com/terraform/0.7.13/terraform_0.7.13_linux_amd64.zip - - mkdir terraform && unzip terraform.zip -d terraform + - mkdir terraform + - unzip terraform.zip -d terraform + bundler_args: --without=development + before_script: skip script: - bundle exec kitchen test --log-level debug after_success: [] - stage: deploy - install: [] - script: [] + install: skip + before_script: skip + script: skip after_success: [] before_deploy: - openssl aes-256-cbc -K $encrypted_8cfc0ec71995_key -iv $encrypted_8cfc0ec71995_iv -in certs/private_key.pem.enc -out certs/private_key.pem -d