language: ruby rvm: - "2.2.9" - "2.3.6" - "2.4" - "2.5" jobs: include: - stage: deploy rvm: "2.3.6" install: true script: true cache: before_deploy: - sed -i.bak "s/VERSION = '.*'/VERSION = '${DPL_VERSION}'/g" lib/dpl/version.rb - git config user.name "travisbot" - git config user.email "deploy@travis-ci.org" - git add lib/dpl/version.rb - git commit -m "Update DPL::Version" deploy: - provider: rubygems api_key: secure: ZmZoDL1tilWvQrqRWDm2K4xQ5Grt9eRJzYVZPLANR0P1TM5BJBLk+UhWCWCPkkDVIBWMa5ANsiFYBxtH65Lw+uqMztSpVusk0l0LQXZGv9jMpT9445A8008U3vvfS0ke7IG8Q4bMAC7Sd6VGaiHDyZC7zmNvnqMpmVX7ShcgBME= gem: dpl edge: branch: v1.9 gemspec_glob: 'dpl*.gemspec' on: repo: travis-ci/dpl rvm: 2.3.6 branch: v1.9 env: global: - DPL_VERSION=$(ruby -I lib -r dpl/version.rb -e "puts DPL::VERSION.succ + \".travis.#{ENV['TRAVIS_JOB_NUMBER']}\"") - BUNDLE_PATH=$TRAVIS_BUILD_DIR/bundle sudo: false cache: directories: - vendor/cache - bundle before_install: - gem update bundler script: - bundle exec rspec spec/cli_spec.rb spec/provider_spec.rb - gem build dpl.gemspec && gem install dpl-*.gem - echo -e "\n${ANSI_GREEN}Run specs${ANSI_RESET}" - | spec_errors=0 for f in dpl-*.gemspec; do base=${f%*.gemspec}; name=${base#dpl-*} echo -e "\n${ANSI_GREEN}${base}${ANSI_RESET}\n" echo -e "source 'https://rubygems.org'\ngemspec :name => \"dpl-${name}\"" > Gemfile-${name} export BUNDLE_GEMFILE=Gemfile-${name} bundle install --gemfile Gemfile-${name} --path=vendor/cache/dpl-${name} --binstubs=bin && ./bin/rspec spec/provider/${name}_spec.rb if [[ $? -ne 0 ]]; then echo -e "${ANSI_RED}${name} specs failed${ANSI_RESET}" && let spec_errors=$spec_errors+1 fi done test $spec_errors -eq 0 - echo -e "\n${ANSI_GREEN}Install gem and invoke dpl${ANSI_RESET}" - | no_err=0 export BUNDLE_GEMFILE=Gemfile for f in dpl-*.gemspec; do base=${f%*.gemspec}; name=${base#dpl-*} echo -e "\n${ANSI_GREEN}${base}${ANSI_RESET}\n" gem build --silent $f && gem install --no-post-install-message dpl-${name}-*.gem && ( dpl --provider=${name} --no-deploy ) if [[ $? -ne 0 ]]; then echo -e "${ANSI_RED}${name} invocation failed${ANSI_RESET}" && let no_err=$no_err+1 fi done test $no_err -eq 0 # - bundle exec rake && gem build dpl.gemspec && gem install dpl-*.gem && dpl --provider=script --script='echo foo' notifications: webhooks: "http://requestb.in/1guaq7t1"