From c2d1a0c18ee21f3e0bfceb913e193f3f3093b341 Mon Sep 17 00:00:00 2001 From: Peter Souter Date: Wed, 21 Dec 2016 15:20:08 +0000 Subject: [PATCH] Updates r10k to 2.5.0 * Lots of new features in the 2.0.0 branch * Was a breaking release, but not many big breakages * Main change is the deprecation of older Ruby (1.8.7) and `R10K::Task` becoming `R10K::Action` --- .ruby-version | 2 +- .travis.yml | 2 +- Gemfile | 2 +- Gemfile.lock | 145 +++++++++++++++++------------- lib/vagrant-r10k/action/deploy.rb | 12 ++- spec/unit/action_deploy_spec.rb | 14 +-- spec/unit/shared_expectations.rb | 4 +- vagrant-r10k.gemspec | 2 +- 8 files changed, 102 insertions(+), 81 deletions(-) diff --git a/.ruby-version b/.ruby-version index 3e3c2f1..21bb5e1 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.1.1 +2.2.5 diff --git a/.travis.yml b/.travis.yml index 0cc9939..2e788f8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,7 @@ script: bundle _${BUNDLER_VERSION}_ exec rspec --color --format documentation notifications: email: true rvm: - - 2.0.0 + - 2.2.5 env: global: - NOKOGIRI_USE_SYSTEM_LIBRARIES=true diff --git a/Gemfile b/Gemfile index ea5cb11..98fbfaa 100644 --- a/Gemfile +++ b/Gemfile @@ -9,7 +9,7 @@ group :development do gem "vagrant", git: "https://github.com/mitchellh/vagrant.git", branch: 'master' end # pinned to branch for https://github.com/mitchellh/vagrant-spec/pull/16 - gem 'vagrant-spec', :github => 'jantman/vagrant-spec', :ref => 'junit_and_env' + gem 'vagrant-spec', :git => 'https://github.com/jantman/vagrant-spec', :ref => 'junit_and_env' gem 'simplecov', :require => false gem 'codecov', :require => false gem "rspec_junit_formatter", :require => false diff --git a/Gemfile.lock b/Gemfile.lock index 158effc..8a0fe14 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,5 +1,13 @@ GIT - remote: git://github.com/jantman/vagrant-spec.git + remote: https://github.com/jantman/rspec-matcher-num-times.git + revision: 03409dfc6a96bb8b3c7c60d8b28ccd20b02cc8c0 + branch: rspec2 + specs: + rspec-matcher-num-times (0.0.1) + rspec (>= 2.0) + +GIT + remote: https://github.com/jantman/vagrant-spec revision: d85c6fd2887358b7adc145cf89a4bfb420f7f714 ref: junit_and_env specs: @@ -9,42 +17,34 @@ GIT rspec (~> 2.14) thor (~> 0.18.1) -GIT - remote: https://github.com/jantman/rspec-matcher-num-times.git - revision: 03409dfc6a96bb8b3c7c60d8b28ccd20b02cc8c0 - branch: rspec2 - specs: - rspec-matcher-num-times (0.0.1) - rspec (>= 2.0) - GIT remote: https://github.com/mitchellh/vagrant.git - revision: 78ea5e4a78ce644717ab16d8001ab77430168f0f - tag: v1.7.4 + revision: a3b9d231ade60868219062ceae54443b6e0e1b5b + branch: master specs: - vagrant (1.7.4) - bundler (>= 1.5.2, <= 1.10.5) + vagrant (1.9.2.dev) childprocess (~> 0.5.0) erubis (~> 2.7.0) hashicorp-checkpoint (~> 0.1.1) i18n (>= 0.6.0, <= 0.8.0) - listen (~> 3.0.2) + listen (~> 3.1.5) log4r (~> 1.1.9, < 1.1.11) net-scp (~> 1.1.0) net-sftp (~> 2.1) - net-ssh (>= 2.6.6, < 2.10.0) - nokogiri (= 1.6.3.1) + net-ssh (~> 3.0.1) + nokogiri (= 1.6.7.1) rb-kqueue (~> 0.2.0) - rest-client (>= 1.6.0, < 2.0) + rest-client (>= 1.6.0, < 3.0) + ruby_dep (<= 1.3.1) wdm (~> 0.1.0) - winrm (~> 1.3) - winrm-fs (~> 0.2.0) + winrm (~> 1.6) + winrm-fs (~> 0.3.0) PATH remote: . specs: vagrant-r10k (0.4.1) - r10k (~> 1.5.0) + r10k (~> 2.5.0) GEM remote: https://rubygems.org/ @@ -61,69 +61,82 @@ GEM colored (~> 1.2) diff-lcs (1.2.5) docile (1.1.5) - domain_name (0.5.25) + domain_name (0.5.20161129) unf (>= 0.0.5, < 1.0.0) erubis (2.7.0) faraday (0.9.2) multipart-post (>= 1.2, < 3) - faraday_middleware (0.9.2) - faraday (>= 0.7.4, < 0.10) - faraday_middleware-multi_json (0.0.6) - faraday_middleware - multi_json + faraday_middleware (0.10.1) + faraday (>= 0.7.4, < 1.0) + fast_gettext (1.1.0) ffi (1.9.10) + gettext (3.2.2) + locale (>= 2.0.5) + text (>= 1.3.0) + gettext-setup (0.10) + fast_gettext (~> 1.1.0) + gettext (>= 3.0.2) gssapi (1.2.0) ffi (>= 1.0.1) gyoku (1.3.1) builder (>= 2.1.2) hashicorp-checkpoint (0.1.4) - http-cookie (1.0.2) + http-cookie (1.0.3) domain_name (~> 0.5) - httpclient (2.6.0.1) + httpclient (2.8.3) i18n (0.7.0) json (1.8.3) - json_pure (1.8.3) - listen (3.0.3) - rb-fsevent (>= 0.9.3) - rb-inotify (>= 0.9) + listen (3.1.5) + rb-fsevent (~> 0.9, >= 0.9.4) + rb-inotify (~> 0.9, >= 0.9.7) + ruby_dep (~> 1.2) little-plugger (1.1.4) + locale (2.1.2) log4r (1.1.10) - logging (1.8.2) - little-plugger (>= 1.1.3) - multi_json (>= 1.8.4) - mime-types (2.6.2) - mini_portile (0.6.0) - multi_json (1.11.2) + logging (2.1.0) + little-plugger (~> 1.1) + multi_json (~> 1.10) + mime-types (3.1) + mime-types-data (~> 3.2015) + mime-types-data (3.2016.0521) + mini_portile2 (2.0.0) + minitar (0.5.4) + multi_json (1.12.1) multipart-post (2.0.0) net-scp (1.1.2) net-ssh (>= 2.6.5) net-sftp (2.1.2) net-ssh (>= 2.6.5) - net-ssh (2.9.2) - netrc (0.10.3) - nokogiri (1.6.3.1) - mini_portile (= 0.6.0) + net-ssh (3.0.2) + netrc (0.11.0) + nokogiri (1.6.7.1) + mini_portile2 (~> 2.0.0.rc2) nori (2.6.0) - r10k (1.5.1) + puppet_forge (2.2.2) + faraday (~> 0.9.0) + faraday_middleware (>= 0.9.0, < 0.11.0) + gettext-setup (>= 0.3) + minitar + semantic_puppet (~> 0.1.0) + r10k (2.5.1) colored (= 1.2) cri (~> 2.6.1) - faraday (~> 0.9.0) - faraday_middleware (~> 0.9.0) - faraday_middleware-multi_json (~> 0.0.6) - json_pure (~> 1.8) + gettext-setup (~> 0.5) log4r (= 1.1.10) + minitar multi_json (~> 1.10) + puppet_forge (~> 2.2) semantic_puppet (~> 0.1.0) rake (10.4.2) - rb-fsevent (0.9.6) - rb-inotify (0.9.5) + rb-fsevent (0.9.8) + rb-inotify (0.9.7) ffi (>= 0.5.0) rb-kqueue (0.2.4) ffi (>= 0.5.0) - rest-client (1.8.0) + rest-client (2.0.0) http-cookie (>= 1.0.2, < 2.0) - mime-types (>= 1.16, < 3.0) - netrc (~> 0.7) + mime-types (>= 1.16, < 4.0) + netrc (~> 0.8) rspec (2.99.0) rspec-core (~> 2.99.0) rspec-expectations (~> 2.99.0) @@ -135,35 +148,36 @@ GEM rspec_junit_formatter (0.2.3) builder (< 4) rspec-core (>= 2, < 4, != 2.12.0) - rubyntlm (0.4.0) - rubyzip (1.1.7) - semantic_puppet (0.1.1) + ruby_dep (1.3.1) + rubyntlm (0.6.1) + rubyzip (1.2.0) + semantic_puppet (0.1.4) + gettext-setup (>= 0.3) simplecov (0.10.0) docile (~> 1.1.0) json (~> 1.8) simplecov-html (~> 0.10.0) simplecov-html (0.10.0) + text (1.3.1) thor (0.18.1) unf (0.1.4) unf_ext - unf_ext (0.0.7.1) + unf_ext (0.0.7.2) url (0.3.2) - uuidtools (2.1.5) wdm (0.1.1) - winrm (1.3.4) + winrm (1.8.1) builder (>= 2.1.2) gssapi (~> 1.2) gyoku (~> 1.0) httpclient (~> 2.2, >= 2.2.0.2) - logging (~> 1.6, >= 1.6.1) + logging (>= 1.6.1, < 3.0) nori (~> 2.0) - rubyntlm (~> 0.4.0) - uuidtools (~> 2.1.2) - winrm-fs (0.2.2) + rubyntlm (~> 0.6.0) + winrm-fs (0.3.2) erubis (~> 2.7) - logging (~> 1.6, >= 1.6.1) + logging (>= 1.6.1, < 3.0) rubyzip (~> 1.1) - winrm (~> 1.3.0) + winrm (~> 1.5) PLATFORMS ruby @@ -178,3 +192,6 @@ DEPENDENCIES vagrant! vagrant-r10k! vagrant-spec! + +BUNDLED WITH + 1.13.6 diff --git a/lib/vagrant-r10k/action/deploy.rb b/lib/vagrant-r10k/action/deploy.rb index ff2df1b..79a8e0f 100644 --- a/lib/vagrant-r10k/action/deploy.rb +++ b/lib/vagrant-r10k/action/deploy.rb @@ -1,4 +1,6 @@ require_relative 'base' +require 'puppet_forge' +require 'vagrant-r10k/version' module VagrantPlugins module R10k @@ -6,6 +8,8 @@ module Action # run r10k deploy class Deploy < Base + PuppetForge.user_agent = "vagrant-r10k/#{VagrantPlugins::R10k::VERSION}" + # determine if we should run, and get config def call(env) @logger.debug "vagrant::r10k::deploy called" @@ -39,8 +43,8 @@ def call(env) # run the actual r10k deploy def deploy(env, config) @logger.debug("vagrant::r10k::deploy.deploy called") - require 'r10k/task_runner' - require 'r10k/task/puppetfile' + require 'r10k/action/runner' + require 'r10k/action/puppetfile' env[:ui].info "vagrant-r10k: Beginning r10k deploy of puppet modules into #{config[:module_path]} using #{config[:puppetfile_path]}" @@ -58,8 +62,8 @@ def deploy(env, config) runner = R10K::TaskRunner.new([]) begin puppetfile = get_puppetfile(config) - @logger.debug("vagrant-r10k: creating Puppetfile::Sync task") - task = R10K::Task::Puppetfile::Sync.new(puppetfile) + @logger.debug("vagrant-r10k: creating R10K::Action::Puppetfile::Install task") + task = R10K::Action::Puppetfile::Install(puppetfile) @logger.debug("vagrant-r10k: appending task to runner queue") runner.append_task task @logger.debug("vagrant-r10k: running sync task") diff --git a/spec/unit/action_deploy_spec.rb b/spec/unit/action_deploy_spec.rb index 6d21761..533c5c3 100644 --- a/spec/unit/action_deploy_spec.rb +++ b/spec/unit/action_deploy_spec.rb @@ -3,7 +3,7 @@ require_relative 'shared_expectations' require 'vagrant-r10k/action/base' require 'vagrant-r10k/action/deploy' -require 'r10k/task/puppetfile' +require 'r10k/action/puppetfile' require 'r10k/git/errors' require 'r10k/errors' @@ -235,7 +235,7 @@ allow(runner_dbl).to receive(:succeeded?).and_return(true) allow(sync_dbl).to receive(:new).with(puppetfile_dbl) R10K::TaskRunner.stub(:new) { runner_dbl } - R10K::Task::Puppetfile::Sync.stub(:new) { sync_dbl } + R10K::Action::Puppetfile::Install.stub(:new) { sync_dbl } # expectations expect(R10K::Logging).to receive(:level=).with('info').twice expect(ui).to receive(:info).with("vagrant-r10k: Beginning r10k deploy of puppet modules into module/path using puppetfile/path") @@ -290,7 +290,7 @@ allow(runner_dbl).to receive(:succeeded?).and_return(true) allow(sync_dbl).to receive(:new).with(puppetfile_dbl) R10K::TaskRunner.stub(:new) { runner_dbl } - R10K::Task::Puppetfile::Sync.stub(:new) { sync_dbl } + R10K::Action::Puppetfile::Install.stub(:new) { sync_dbl } # expectations expect(R10K::Logging).to receive(:level=).with('debug').twice expect(ui).to receive(:info).with("vagrant-r10k: Beginning r10k deploy of puppet modules into module/path using puppetfile/path") @@ -344,7 +344,7 @@ allow(runner_dbl).to receive(:succeeded?).and_return(true) allow(sync_dbl).to receive(:new).with(puppetfile_dbl) R10K::TaskRunner.stub(:new) { runner_dbl } - R10K::Task::Puppetfile::Sync.stub(:new) { sync_dbl } + R10K::Action::Puppetfile::Install.stub(:new) { sync_dbl } # expectations expect(ui).to receive(:info).with("vagrant-r10k: Beginning r10k deploy of puppet modules into module/path using puppetfile/path") logger = subject.instance_variable_get(:@logger) @@ -404,7 +404,7 @@ ]]) allow(sync_dbl).to receive(:new).with(puppetfile_dbl) R10K::TaskRunner.stub(:new) { runner_dbl } - R10K::Task::Puppetfile::Sync.stub(:new) { sync_dbl } + R10K::Action::Puppetfile::Install.stub(:new) { sync_dbl } # expectations expect(R10K::Logging).to receive(:level=).with('info').twice expect(ui).to receive(:info).with("vagrant-r10k: Beginning r10k deploy of puppet modules into module/path using puppetfile/path") @@ -465,7 +465,7 @@ ]]) allow(sync_dbl).to receive(:new).with(puppetfile_dbl) R10K::TaskRunner.stub(:new) { runner_dbl } - R10K::Task::Puppetfile::Sync.stub(:new) { sync_dbl } + R10K::Action::Puppetfile::Install.stub(:new) { sync_dbl } # expectations expect(R10K::Logging).to receive(:level=).with('info').twice expect(ui).to receive(:info).with("vagrant-r10k: Beginning r10k deploy of puppet modules into module/path using puppetfile/path") @@ -525,7 +525,7 @@ allow(runner_dbl).to receive(:run).and_raise(ex) allow(sync_dbl).to receive(:new).with(puppetfile_dbl) R10K::TaskRunner.stub(:new) { runner_dbl } - R10K::Task::Puppetfile::Sync.stub(:new) { sync_dbl } + R10K::Action::Puppetfile::Install.stub(:new) { sync_dbl } # expectations expect(R10K::Logging).to receive(:level=).with('info').twice expect(ui).to receive(:info).with("vagrant-r10k: Beginning r10k deploy of puppet modules into module/path using puppetfile/path") diff --git a/spec/unit/shared_expectations.rb b/spec/unit/shared_expectations.rb index afebafc..05f9e50 100644 --- a/spec/unit/shared_expectations.rb +++ b/spec/unit/shared_expectations.rb @@ -10,8 +10,8 @@ def expect_ran_successfully(vars) expect(vars[:ui]).to receive(:info).with(/Beginning r10k deploy/).once R10K::Puppetfile.stub(:new) expect(R10K::Puppetfile).to receive(:new).with(full_puppet_dir, full_module_path, full_puppetfile_path).once - R10K::Task::Puppetfile::Sync.stub(:new).and_call_original - expect(R10K::Task::Puppetfile::Sync).to receive(:new).once + R10K::Action::Puppetfile::Install.stub(:new).and_call_original + expect(R10K::Action::Puppetfile::Install).to receive(:new).once runner = R10K::TaskRunner.new([]) R10K::TaskRunner.stub(:new).and_return(runner) R10K::TaskRunner.stub(:append_task).and_call_original diff --git a/vagrant-r10k.gemspec b/vagrant-r10k.gemspec index f55d0cf..5026976 100644 --- a/vagrant-r10k.gemspec +++ b/vagrant-r10k.gemspec @@ -19,7 +19,7 @@ Gem::Specification.new do |spec| spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) spec.require_paths = ["lib"] - spec.add_runtime_dependency "r10k", "~> 1.5.0" + spec.add_runtime_dependency "r10k", "~> 2.5.0" spec.add_development_dependency "bundler", "~> 1.5" spec.add_development_dependency "rake"