From 122a06c5355c9d804e0d6d1161548c7fcb481d65 Mon Sep 17 00:00:00 2001 From: Lukas Bezdicka Date: Mon, 4 May 2015 13:22:40 +0200 Subject: [PATCH] Update vcsrepo to b02a409d141e70b93fe39df84ec3217cbb60ec0f b02a409d141e70b93fe39df84ec3217cbb60ec0f Merge pull request #241 from tykeal/master 126a2bde0ba826d334df04725c062a286e354105 Merge pull request #237 from cmurphy/rspec-puppet-2 7aab800dff04c485308edd906ce234e83ffb154e Merge pull request #224 from puppet-by-examples/single-branch a618f2be009b44df5fe91a1d6863bb55bc50020f Clean up puppet lint warnings 7dc0025a0c8f3ddea12bf642a69a62e22daef071 Update .travis.yml 6ec1fc6a118579c4983aecf5275dbfdd00f59392 Keep testing on puppet 2.7 1089bf192413a9b6f64d1087cc623d6532477337 Unpin rspec-puppet and remove unneeded deps 28f8646e4669bacf7a87ffc8694715333355cd32 Use branch parameter Change-Id: Iebe393b0679ce0ae9dc68a2046cff84783a471e5 --- Puppetfile | 2 +- vcsrepo/.sync.yml | 5 +++++ vcsrepo/.travis.yml | 19 +++++++++++++++---- vcsrepo/Gemfile | 3 --- vcsrepo/examples/p4/create_client.pp | 4 ++-- vcsrepo/examples/p4/delete_client.pp | 4 ++-- vcsrepo/examples/p4/latest_client.pp | 6 +++--- vcsrepo/examples/p4/sync_client.pp | 8 ++++---- vcsrepo/lib/puppet/provider/vcsrepo/git.rb | 5 ++++- vcsrepo/lib/puppet/type/vcsrepo.rb | 7 +++++++ 10 files changed, 43 insertions(+), 20 deletions(-) diff --git a/Puppetfile b/Puppetfile index 0b9e4ff2a..38e6e9cf5 100644 --- a/Puppetfile +++ b/Puppetfile @@ -219,7 +219,7 @@ mod 'tuskar', :git => 'https://github.com/stackforge/puppet-tuskar.git' mod 'vcsrepo', - :commit => '210ca5acd8eecc909eae248745e24f0debd66ffc', + :commit => 'b02a409d141e70b93fe39df84ec3217cbb60ec0f', :git => 'https://github.com/puppetlabs/puppetlabs-vcsrepo.git' mod 'vlan', diff --git a/vcsrepo/.sync.yml b/vcsrepo/.sync.yml index 6fa460a29..02c6c83b8 100644 --- a/vcsrepo/.sync.yml +++ b/vcsrepo/.sync.yml @@ -1,6 +1,11 @@ --- .travis.yml: script: "\"bundle exec rake spec SPEC_OPTS='--format documentation'\"" + extras: + - rvm: 1.8.7 + env: PUPPET_GEM_VERSION="~> 2.7.0" FACTER_GEM_VERSION="~> 1.6.0" + - rvm: 1.8.7 + env: PUPPET_GEM_VERSION="~> 2.7.0" FACTER_GEM_VERSION="~> 1.7.0" Rakefile: unmanaged: true spec/spec_helper.rb: diff --git a/vcsrepo/.travis.yml b/vcsrepo/.travis.yml index 8cfaf2319..0fc75e313 100644 --- a/vcsrepo/.travis.yml +++ b/vcsrepo/.travis.yml @@ -1,17 +1,28 @@ --- +sudo: false language: ruby bundler_args: --without system_tests script: "bundle exec rake spec SPEC_OPTS='--format documentation'" matrix: fast_finish: true include: + - rvm: 1.9.3 + env: PUPPET_GEM_VERSION="~> 3.4.0" - rvm: 1.8.7 - env: PUPPET_GEM_VERSION="~> 2.7.0" FACTER_GEM_VERSION="~> 1.6.0" - - rvm: 1.8.7 - env: PUPPET_GEM_VERSION="~> 2.7.0" FACTER_GEM_VERSION="~> 1.7.0" + env: PUPPET_GEM_VERSION="~> 3.0" - rvm: 1.9.3 env: PUPPET_GEM_VERSION="~> 3.0" - - rvm: 2.0.0 + - rvm: 1.9.3 + env: PUPPET_GEM_VERSION="~> 3.0" FUTURE_PARSER="yes" + - rvm: 2.1.5 env: PUPPET_GEM_VERSION="~> 3.0" + - rvm: 2.1.5 + env: PUPPET_GEM_VERSION="~> 3.4.0" + - rvm: 2.1.5 + env: PUPPET_GEM_VERSION="~> 3.0" FUTURE_PARSER="yes" + - rvm: 1.8.7 + env: PUPPET_GEM_VERSION="~> 2.7.0" FACTER_GEM_VERSION="~> 1.6.0" + - rvm: 1.8.7 + env: PUPPET_GEM_VERSION="~> 2.7.0" FACTER_GEM_VERSION="~> 1.7.0" notifications: email: false diff --git a/vcsrepo/Gemfile b/vcsrepo/Gemfile index e1ae0fa56..fcd27d534 100644 --- a/vcsrepo/Gemfile +++ b/vcsrepo/Gemfile @@ -11,11 +11,8 @@ def location_for(place, fake_version = nil) end group :development, :unit_tests do - gem 'rake', :require => false gem 'rspec-core', '3.1.7', :require => false - gem 'rspec-puppet', '~> 1.0', :require => false gem 'puppetlabs_spec_helper', :require => false - gem 'puppet-lint', :require => false gem 'simplecov', :require => false gem 'puppet_facts', :require => false gem 'json', :require => false diff --git a/vcsrepo/examples/p4/create_client.pp b/vcsrepo/examples/p4/create_client.pp index 0f8233aa1..3cf916020 100644 --- a/vcsrepo/examples/p4/create_client.pp +++ b/vcsrepo/examples/p4/create_client.pp @@ -1,4 +1,4 @@ vcsrepo { '/tmp/vcstest/p4_client_root': - ensure => present, - provider => 'p4', + ensure => present, + provider => 'p4', } diff --git a/vcsrepo/examples/p4/delete_client.pp b/vcsrepo/examples/p4/delete_client.pp index 1e305f126..82c9c9523 100644 --- a/vcsrepo/examples/p4/delete_client.pp +++ b/vcsrepo/examples/p4/delete_client.pp @@ -1,4 +1,4 @@ vcsrepo { '/tmp/vcstest/p4_client_root': - ensure => absent, - provider => 'p4', + ensure => absent, + provider => 'p4', } diff --git a/vcsrepo/examples/p4/latest_client.pp b/vcsrepo/examples/p4/latest_client.pp index a7caeb68d..106ef9e99 100644 --- a/vcsrepo/examples/p4/latest_client.pp +++ b/vcsrepo/examples/p4/latest_client.pp @@ -1,5 +1,5 @@ vcsrepo { '/tmp/vcstest/p4_client_root': - ensure => latest, - provider => 'p4', - source => '//depot/...', + ensure => latest, + provider => 'p4', + source => '//depot/...', } diff --git a/vcsrepo/examples/p4/sync_client.pp b/vcsrepo/examples/p4/sync_client.pp index fc0e29c22..33e473177 100644 --- a/vcsrepo/examples/p4/sync_client.pp +++ b/vcsrepo/examples/p4/sync_client.pp @@ -1,6 +1,6 @@ vcsrepo { '/tmp/vcstest/p4_client_root': - ensure => present, - provider => 'p4', - source => '//depot/...', - revision => '30', + ensure => present, + provider => 'p4', + source => '//depot/...', + revision => '30', } diff --git a/vcsrepo/lib/puppet/provider/vcsrepo/git.rb b/vcsrepo/lib/puppet/provider/vcsrepo/git.rb index 000032e97..810125323 100644 --- a/vcsrepo/lib/puppet/provider/vcsrepo/git.rb +++ b/vcsrepo/lib/puppet/provider/vcsrepo/git.rb @@ -5,7 +5,7 @@ commands :git => 'git' - has_features :bare_repositories, :reference_tracking, :ssh_identity, :multiple_remotes, :user, :depth, :submodules + has_features :bare_repositories, :reference_tracking, :ssh_identity, :multiple_remotes, :user, :depth, :branch, :submodules def create if @resource.value(:revision) and @resource.value(:ensure) == :bare @@ -181,6 +181,9 @@ def clone_repository(source, path) if @resource.value(:depth) and @resource.value(:depth).to_i > 0 args.push('--depth', @resource.value(:depth).to_s) end + if @resource.value(:branch) + args.push('--branch', @resource.value(:branch).to_s) + end if @resource.value(:ensure) == :bare args << '--bare' end diff --git a/vcsrepo/lib/puppet/type/vcsrepo.rb b/vcsrepo/lib/puppet/type/vcsrepo.rb index 52eace85d..e5dfbb5f5 100644 --- a/vcsrepo/lib/puppet/type/vcsrepo.rb +++ b/vcsrepo/lib/puppet/type/vcsrepo.rb @@ -40,6 +40,9 @@ feature :depth, "The provider can do shallow clones" + feature :branch, + "The name of the branch" + feature :p4config, "The provider understands Perforce Configuration" @@ -207,6 +210,10 @@ def retrieve desc "The value to be used to do a shallow clone." end + newparam :branch, :required_features => [:branch] do + desc "The name of the branch to clone." + end + newparam :p4config, :required_features => [:p4config] do desc "The Perforce P4CONFIG environment." end