From 175da91049136d21d71f617bfeb86b160a7775e4 Mon Sep 17 00:00:00 2001 From: Bart-Jan Vrielink Date: Wed, 10 Apr 2019 09:52:46 +0200 Subject: [PATCH 1/9] Travis update --- .travis.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index a1e996f..4460913 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,10 +12,10 @@ script: - "bundle exec rake syntax" - "bundle exec rake spec SPEC_OPTS='--format documentation'" rvm: - - 1.9.3 - 2.0.0 - 2.1 - 2.2 + - 2.4.5 env: - PUPPET_VERSION="~> 3.2.0" - PUPPET_VERSION="~> 3.3.0" @@ -24,15 +24,10 @@ env: - PUPPET_VERSION="~> 3.6.0" - PUPPET_VERSION="~> 3.7.0" - PUPPET_VERSION="~> 4.0.0" + - PUPPET_VERSION="~> 5.5.0" global: - PUBLISHER_LOGIN=abrader notifications: email: false - webhooks: - urls: - - 'https://webhooks.gitter.im/e/16f24db0492933fce79d' - on_success: change - on_failure: always - on_start: false From 5ecfb80f20537f825cab20eb9ecc3f2eaf37f3f8 Mon Sep 17 00:00:00 2001 From: ricou84 Date: Thu, 21 Sep 2017 15:17:55 +0200 Subject: [PATCH 2/9] Merge pull request #1 from ricou84/ricou84-patch-1 replace / by %2F in project stored on sub-sub-group --- lib/puppet/provider/git_deploy_key/gitlab.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/puppet/provider/git_deploy_key/gitlab.rb b/lib/puppet/provider/git_deploy_key/gitlab.rb index 059974d..9b0c775 100644 --- a/lib/puppet/provider/git_deploy_key/gitlab.rb +++ b/lib/puppet/provider/git_deploy_key/gitlab.rb @@ -96,7 +96,7 @@ def get_project_id raise(Puppet::Error, "gitlab_deploy_key::#{calling_method}: Must provide at least one of the following attributes: project_id or project_name") end - project_name = resource[:project_name].strip.sub('/','%2F') + project_name = resource[:project_name].strip.gsub('/','%2F') url = "#{gms_server}/api/v3/projects/#{project_name}" From 99fb68d7adab44739c5b69929c883ee3ae216062 Mon Sep 17 00:00:00 2001 From: Maximilian Stinsky Date: Tue, 15 Jan 2019 19:53:28 +0100 Subject: [PATCH 3/9] Add gitlab_api_version to decide which api version to use --- lib/puppet/provider/git_deploy_key/gitlab.rb | 26 ++++++++++++++----- lib/puppet/provider/git_groupteam/gitlab.rb | 14 +++++----- .../provider/git_groupteam_member/gitlab.rb | 16 +++++++----- lib/puppet/provider/git_webhook/gitlab.rb | 16 +++++++----- lib/puppet/provider/gms_webhook/gitlab.rb | 16 +++++++----- lib/puppet/type/git_deploy_key.rb | 7 ++++- lib/puppet/type/git_groupteam.rb | 7 ++++- lib/puppet/type/git_groupteam_member.rb | 7 ++++- lib/puppet/type/git_webhook.rb | 7 ++++- lib/puppet/type/gms_webhook.rb | 6 +++++ 10 files changed, 85 insertions(+), 37 deletions(-) diff --git a/lib/puppet/provider/git_deploy_key/gitlab.rb b/lib/puppet/provider/git_deploy_key/gitlab.rb index 9b0c775..02a1a16 100644 --- a/lib/puppet/provider/git_deploy_key/gitlab.rb +++ b/lib/puppet/provider/git_deploy_key/gitlab.rb @@ -13,6 +13,18 @@ def gms_server return 'https://gitlab.com' end + def api_version + return resource[:gitlab_api_version] + end + + def keys_endpoint + if api_version.to_s.eql? "v3" + return 'keys' + else + return 'deploy_keys' + end + end + def calling_method # Get calling method and clean it up for good reporting cm = String.new @@ -69,7 +81,8 @@ def exists? project_id = get_project_id sshkey_hash = Hash.new - url = "#{gms_server}/api/v3/projects/#{project_id}/keys" + + url = "#{gms_server}/api/#{api_version}/projects/#{project_id}/#{keys_endpoint}" response = api_call('GET', url) @@ -98,7 +111,7 @@ def get_project_id project_name = resource[:project_name].strip.gsub('/','%2F') - url = "#{gms_server}/api/v3/projects/#{project_name}" + url = "#{gms_server}/api/#{api_version}/projects/#{project_name}" begin response = api_call('GET', url) @@ -115,7 +128,7 @@ def get_key_id keys_hash = Hash.new - url = "#{gms_server}/api/v3/projects/#{project_id}/keys" + url = "#{gms_server}/api/#{api_version}/projects/#{project_id}/#{keys_endpoint}" response = api_call('GET', url) @@ -138,7 +151,7 @@ def get_key_id def create project_id = get_project_id - url = "#{gms_server}/api/v3/projects/#{project_id}/keys" + url = "#{gms_server}/api/#{api_version}/projects/#{project_id}/#{keys_endpoint}" begin response = api_call('POST', url, {'title' => resource[:name].strip, 'key' => File.read(resource[:path].strip)}) @@ -159,7 +172,8 @@ def destroy key_id = get_key_id unless key_id.nil? - url = "#{gms_server}/api/v3/projects/#{project_id}/keys/#{key_id}" + + url = "#{gms_server}/api/#{api_version}/projects/#{project_id}/#{keys_endpoint}/#{key_id}" begin response = api_call('DELETE', url) @@ -177,5 +191,3 @@ def destroy end end - - diff --git a/lib/puppet/provider/git_groupteam/gitlab.rb b/lib/puppet/provider/git_groupteam/gitlab.rb index c8f704e..11d1b09 100644 --- a/lib/puppet/provider/git_groupteam/gitlab.rb +++ b/lib/puppet/provider/git_groupteam/gitlab.rb @@ -13,6 +13,10 @@ def gms_server return 'https://gitlab.com' end + def api_version + return resource[:gitlab_api_version] + end + def calling_method # Get calling method and clean it up for good reporting cm = String.new @@ -67,7 +71,7 @@ def api_call(action,url,data = nil) def exists? groupteam_hash = Hash.new - url = "#{gms_server}/api/v3/groups" + url = "#{gms_server}/api/#{api_version}/groups" response = api_call('GET', url) @@ -96,7 +100,7 @@ def exists? def get_group_id group_hash = Hash.new - url = "#{gms_server}/api/v3/groups" + url = "#{gms_server}/api/#{api_version}/groups" response = api_call('GET', url) @@ -117,7 +121,7 @@ def get_group_id end def create - url = "#{gms_server}/api/v3/groups" + url = "#{gms_server}/api/#{api_version}/groups" begin opts = { 'name' => resource[:groupteam_name].strip, 'path' => resource[:groupteam_name].strip } @@ -144,7 +148,7 @@ def destroy group_id = get_group_id unless group_id.nil? - url = "#{gms_server}/api/v3/groups/#{group_id}" + url = "#{gms_server}/api/#{api_version}/groups/#{group_id}" begin response = api_call('DELETE', url) @@ -162,5 +166,3 @@ def destroy end end - - diff --git a/lib/puppet/provider/git_groupteam_member/gitlab.rb b/lib/puppet/provider/git_groupteam_member/gitlab.rb index b0afdbc..9d494b5 100644 --- a/lib/puppet/provider/git_groupteam_member/gitlab.rb +++ b/lib/puppet/provider/git_groupteam_member/gitlab.rb @@ -19,6 +19,10 @@ def gms_server return 'https://gitlab.com' end + def api_version + return resource[:gitlab_api_version] + end + def calling_method # Get calling method and clean it up for good reporting cm = String.new @@ -76,7 +80,7 @@ def exists? group_id = get_group_id groupteam_hash = Hash.new - url = "#{gms_server}/api/v3//groups/#{group_id}/members" + url = "#{gms_server}/api/#{api_version}/groups/#{group_id}/members" response = api_call('GET', url) @@ -130,7 +134,7 @@ def get_access_level def get_group_id group_hash = Hash.new - url = "#{gms_server}/api/v3/groups?search=#{resource[:groupteam_name].strip}" + url = "#{gms_server}/api/#{api_version}/groups?search=#{resource[:groupteam_name].strip}" response = api_call('GET', url) @@ -153,7 +157,7 @@ def get_group_id def get_user_id group_hash = Hash.new - url = "#{gms_server}/api/v3/users?search=#{resource[:member_name].strip}" + url = "#{gms_server}/api/#{api_version}/users?search=#{resource[:member_name].strip}" response = api_call('GET', url) @@ -178,7 +182,7 @@ def create group_id = get_group_id user_id = get_user_id - url = "#{gms_server}/api/v3//groups/#{group_id}/members" + url = "#{gms_server}/api/#{api_version}/groups/#{group_id}/members" begin if access_level.nil? || group_id.nil? || user_id.nil? @@ -206,7 +210,7 @@ def destroy user_id = get_user_id unless group_id.nil? - url = "#{gms_server}/api/v3//groups/#{group_id}/members/#{user_id}" + url = "#{gms_server}/api/#{api_version}//groups/#{group_id}/members/#{user_id}" begin response = api_call('DELETE', url) @@ -224,5 +228,3 @@ def destroy end end - - diff --git a/lib/puppet/provider/git_webhook/gitlab.rb b/lib/puppet/provider/git_webhook/gitlab.rb index 5679425..25919ba 100644 --- a/lib/puppet/provider/git_webhook/gitlab.rb +++ b/lib/puppet/provider/git_webhook/gitlab.rb @@ -13,6 +13,10 @@ def gms_server return 'https://gitlab.com' end + def api_version + return resource[:gitlab_api_version] + end + def calling_method # Get calling method and clean it up for good reporting cm = String.new @@ -69,7 +73,7 @@ def exists? project_id = get_project_id webhook_hash = Hash.new - url = "#{gms_server}/api/v3/projects/#{project_id}/hooks" + url = "#{gms_server}/api/#{api_version}/projects/#{project_id}/hooks" response = api_call('GET', url) @@ -99,7 +103,7 @@ def get_project_id project_name = resource[:project_name].strip.sub('/','%2F') - url = "#{gms_server}/api/v3/projects/#{project_name}" + url = "#{gms_server}/api/#{api_version}/projects/#{project_name}" begin response = api_call('GET', url) @@ -116,7 +120,7 @@ def get_webhook_id webhook_hash = Hash.new - url = "#{gms_server}/api/v3/projects/#{project_id}/hooks" + url = "#{gms_server}/api/#{api_version}/projects/#{project_id}/hooks" response = api_call('GET', url) @@ -138,7 +142,7 @@ def get_webhook_id def create project_id = get_project_id - url = "#{gms_server}/api/v3/projects/#{project_id}/hooks" + url = "#{gms_server}/api/#{api_version}/projects/#{project_id}/hooks" begin opts = { 'url' => resource[:webhook_url].strip } @@ -181,7 +185,7 @@ def destroy webhook_id = get_webhook_id unless webhook_id.nil? - url = "#{gms_server}/api/v3/projects/#{project_id}/hooks/#{webhook_id}" + url = "#{gms_server}/api/#{api_version}/projects/#{project_id}/hooks/#{webhook_id}" begin response = api_call('DELETE', url) @@ -199,5 +203,3 @@ def destroy end end - - diff --git a/lib/puppet/provider/gms_webhook/gitlab.rb b/lib/puppet/provider/gms_webhook/gitlab.rb index 51c2e9f..f06f1ec 100644 --- a/lib/puppet/provider/gms_webhook/gitlab.rb +++ b/lib/puppet/provider/gms_webhook/gitlab.rb @@ -28,7 +28,7 @@ def self.instances instances = [] - repos_url = "#{gms_server}/api/v3/projects" + repos_url = "#{gms_server}/api/#{api_version}/projects" repos = get(repos_url, @token) webhooks = Array.new @@ -37,7 +37,7 @@ def self.instances repos.each do |r| # hooks_url = "#{gms_server}/projects/#{r['id']}/hooks" - hooks_url = "#{gms_server}/api/v3/projects/#{r['id']}/hooks" + hooks_url = "#{gms_server}/api/#{api_version}/projects/#{r['id']}/hooks" hook_objs = get(hooks_url, @token) @@ -126,6 +126,10 @@ def gms_server PuppetX::Puppetlabs::Gms::gms_server end + def api_version + return resource[:gitlab_api_version] + end + def calling_method # Get calling method and clean it up for good reporting cm = String.new @@ -137,7 +141,7 @@ def calling_method def get_project_id(project_name) begin - repos_url = "#{self.gms_server}/api/v3/projects" + repos_url = "#{self.gms_server}/api/#{api_version}/projects" repos = PuppetX::Puppetlabs::Gms.get(repos_url, get_token) repos.each do |r| @@ -158,7 +162,7 @@ def exists? def flush Puppet.debug("def flush") - put_url = "#{gms_server}/api/v3/projects/#{get_project_id(resource[:project_name].strip)}/hooks/#{self.id}" + put_url = "#{gms_server}/api/#{api_version}/projects/#{get_project_id(resource[:project_name].strip)}/hooks/#{self.id}" if @property_hash != {} begin @@ -179,7 +183,7 @@ def create Puppet.debug('def create') begin - post_url = "#{self.gms_server}/api/v3/projects/#{get_project_id(resource[:project_name].strip)}/hooks" + post_url = "#{self.gms_server}/api/#{api_version}/projects/#{get_project_id(resource[:project_name].strip)}/hooks" response = PuppetX::Puppetlabs::Gms.post(post_url, get_token, message(resource)) @@ -202,7 +206,7 @@ def destroy Puppet.debug("def destroy") unless webhook_id.nil? - destroy_url = "#{gms_server}/api/v3/projects/#{get_project_id(resource[:project_name].strip)}/hooks/#{self.id}" + destroy_url = "#{gms_server}/api/#{api_version}/projects/#{get_project_id(resource[:project_name].strip)}/hooks/#{self.id}" begin response = PuppetX::Puppetlabs::Gms.delete(destroy_url, get_token) diff --git a/lib/puppet/type/git_deploy_key.rb b/lib/puppet/type/git_deploy_key.rb index 50f9142..1e6956e 100644 --- a/lib/puppet/type/git_deploy_key.rb +++ b/lib/puppet/type/git_deploy_key.rb @@ -61,6 +61,12 @@ module Puppet end end + newparam(:gitlab_api_version) do + desc 'The api version to use with gitlab.' + defaultto :v4 + newvalues(:v3, :v4) + end + autorequire(:file) do self[:path]if self[:path] and Pathname.new(self[:path]).absolute? end @@ -71,4 +77,3 @@ module Puppet end end - diff --git a/lib/puppet/type/git_groupteam.rb b/lib/puppet/type/git_groupteam.rb index a15a105..e3d7e1a 100644 --- a/lib/puppet/type/git_groupteam.rb +++ b/lib/puppet/type/git_groupteam.rb @@ -99,10 +99,15 @@ module Puppet end end + newparam(:gitlab_api_version) do + desc 'The api version to use with gitlab.' + defaultto :v4 + newvalues(:v3, :v4) + end + validate do validate_token_or_token_file end end end - diff --git a/lib/puppet/type/git_groupteam_member.rb b/lib/puppet/type/git_groupteam_member.rb index c32f09e..4341065 100644 --- a/lib/puppet/type/git_groupteam_member.rb +++ b/lib/puppet/type/git_groupteam_member.rb @@ -106,10 +106,15 @@ module Puppet end end + newparam(:gitlab_api_version) do + desc 'The api version to use with gitlab.' + defaultto :v4 + newvalues(:v3, :v4) + end + validate do validate_token_or_token_file end end end - diff --git a/lib/puppet/type/git_webhook.rb b/lib/puppet/type/git_webhook.rb index 0fcb981..05c1c19 100644 --- a/lib/puppet/type/git_webhook.rb +++ b/lib/puppet/type/git_webhook.rb @@ -100,10 +100,15 @@ module Puppet end end + newparam(:gitlab_api_version) do + desc 'The api version to use with gitlab.' + defaultto :v4 + newvalues(:v3, :v4) + end + validate do validate_token_or_token_file end end end - diff --git a/lib/puppet/type/gms_webhook.rb b/lib/puppet/type/gms_webhook.rb index 77aa90c..da51972 100644 --- a/lib/puppet/type/gms_webhook.rb +++ b/lib/puppet/type/gms_webhook.rb @@ -178,6 +178,12 @@ def insync?(is) end end + newparam(:gitlab_api_version) do + desc 'The api version to use with gitlab.' + defaultto :v4 + newvalues(:v3, :v4) + end + read_only_properties = { id: 'id', last_response_code: 'last_response_code', From 0696efb8c407d7f9d83e4446cb6de19a04b865b2 Mon Sep 17 00:00:00 2001 From: Bart-Jan Vrielink Date: Wed, 10 Apr 2019 11:14:46 +0200 Subject: [PATCH 4/9] Added gitlab-ci file --- .gitlab-ci.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..03e9039 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,34 @@ +image: "ruby:2.4.5" + +cache: + paths: + - vendor/ruby + - spec/fixtures + +variables: + PUPPET_LOCATION: 4.10.12 + +before_script: + - gem install bundler --no-document + - bundle install -j $(nproc) --path vendor + +test-syntax: + stage: test + script: + - bundle exec rake syntax + +test-validate: + stage: test + script: + - bundle exec rake validate + +test-lint: + stage: test + script: + - bundle exec rake lint + +test-rspec: + stage: test + script: + - bundle exec rake spec SPEC_OPTS='--format documentation' + coverage: '/Resource coverage: \d+\.\d+/' From 941abd81e0001559d7775b8b42cc8b410ddd09b8 Mon Sep 17 00:00:00 2001 From: Bart-Jan Vrielink Date: Wed, 10 Apr 2019 11:19:42 +0200 Subject: [PATCH 5/9] Updated Gemfile and metadata.json - Set default Puppet version to 5.5.0 - Updated dependencies in metadata.json to more modern versions Note: not switching to Puppet6 yet. It probably will work, but I'm not testing too much with Puppet6 myself. --- Gemfile | 2 +- metadata.json | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/Gemfile b/Gemfile index 6e0d856..43ab7a2 100644 --- a/Gemfile +++ b/Gemfile @@ -12,7 +12,7 @@ end group :test do gem 'rake' - gem 'puppet', *location_for(ENV['PUPPET_LOCATION'] || '~> 3.7.0') + gem 'puppet', *location_for(ENV['PUPPET_LOCATION'] || '~> 5.5.0') gem 'puppetlabs_spec_helper' gem 'webmock' gem 'vcr' diff --git a/metadata.json b/metadata.json index 80d97ea..b7c4082 100644 --- a/metadata.json +++ b/metadata.json @@ -80,19 +80,15 @@ } ], "requirements": [ - { - "name": "pe", - "version_requirement": ">= 3.1.3 < 2015.4.0" - }, { "name": "puppet", - "version_requirement": ">= 3.4.3 < 5.0.0" + "version_requirement": ">= 3.4.3 < 6.0.0" } ], "dependencies": [ { "name": "puppetlabs/stdlib", - "version_requirement": ">=3.2.0 <5.0.0" + "version_requirement": ">=3.2.0 <6.0.0" } ] } From 76cd6660507027be5d2bccfaec427e0bc97b9bd3 Mon Sep 17 00:00:00 2001 From: Bart-Jan Vrielink Date: Wed, 10 Apr 2019 11:46:54 +0200 Subject: [PATCH 6/9] Fixed travis: Puppet versions In Travis, don't test old Puppet with new Ruby versions. --- .travis.yml | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4460913..9fd46ac 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,17 +17,21 @@ rvm: - 2.2 - 2.4.5 env: - - PUPPET_VERSION="~> 3.2.0" - - PUPPET_VERSION="~> 3.3.0" - - PUPPET_VERSION="~> 3.4.0" - - PUPPET_VERSION="~> 3.5.1" - - PUPPET_VERSION="~> 3.6.0" - - PUPPET_VERSION="~> 3.7.0" - - PUPPET_VERSION="~> 4.0.0" - - PUPPET_VERSION="~> 5.5.0" + - PUPPET_LOCATION="~> 3.4.0" + - PUPPET_LOCATION="~> 3.5.1" + - PUPPET_LOCATION="~> 3.6.0" + - PUPPET_LOCATION="~> 3.7.0" + - PUPPET_LOCATION="~> 4.0.0" + - PUPPET_LOCATION="~> 5.5.0" +matrix: + include: + - rvm: 1.9.3 + env: PUPPET_LOCATION="~> 3.2.0" + - rvm: 2.0.0 + env: PUPPET_LOCATION="~> 3.3.0" global: - - PUBLISHER_LOGIN=abrader + - PUBLISHER_LOGIN=bjvrielink notifications: email: false From b1ce43f1d826ab77473456519f9a68568c4b0601 Mon Sep 17 00:00:00 2001 From: Bart-Jan Vrielink Date: Wed, 10 Apr 2019 13:56:40 +0200 Subject: [PATCH 7/9] Gitlab CI and Travis - Deleted some non-supported combinations of Puppet and Ruby from Travis Matrix - Added some form of matrix for Gitlab CI - Gitlab CI fixes for old Puppet versions --- .gitlab-ci.yml | 53 +++++++++++++++++++++++++++++++++++++------------- .travis.yml | 13 +++++++++---- Gemfile | 2 +- 3 files changed, 50 insertions(+), 18 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 03e9039..88d2b1e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,34 +1,61 @@ -image: "ruby:2.4.5" - +--- cache: paths: - vendor/ruby - spec/fixtures variables: + +.puppet400: &puppet400 + PUPPET_LOCATION: 4.0.0 + BUNDLER: '1.7.3' + +.puppet41012: &puppet41012 PUPPET_LOCATION: 4.10.12 + BUNDLER: '1.7.3' -before_script: - - gem install bundler --no-document - - bundle install -j $(nproc) --path vendor +.puppet550: &puppet550 + PUPPET_LOCATION: 5.5.0 + BUNDLER: '>= 0' -test-syntax: - stage: test +.syntax: &syntax script: - bundle exec rake syntax -test-validate: - stage: test +.validate: &validate script: - bundle exec rake validate -test-lint: - stage: test +.lint: &lint script: - bundle exec rake lint -test-rspec: - stage: test +.spec: &spec script: - bundle exec rake spec SPEC_OPTS='--format documentation' coverage: '/Resource coverage: \d+\.\d+/' + +before_script: + - gem install bundler --no-document --version "$BUNDLER" + - bundle install -j $(nproc) --path vendor --without development acceptance + +puppet41012_test: + stage: test + image: "ruby:2.1.9" + <<: [*syntax, *validate, *lint, *spec] + variables: + <<: [*puppet41012] + +puppet550_test: + image: "ruby:2.4.5" + stage: test + <<: [*syntax, *validate, *lint, *spec] + variables: + <<: [*puppet550] + +puppet400_test: + stage: test + image: "ruby:2.1.9" + <<: [*syntax, *validate, *lint, *spec] + variables: + <<: [*puppet400] diff --git a/.travis.yml b/.travis.yml index 9fd46ac..08c06dc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,16 +22,21 @@ env: - PUPPET_LOCATION="~> 3.6.0" - PUPPET_LOCATION="~> 3.7.0" - PUPPET_LOCATION="~> 4.0.0" - - PUPPET_LOCATION="~> 5.5.0" matrix: include: - - rvm: 1.9.3 - env: PUPPET_LOCATION="~> 3.2.0" - rvm: 2.0.0 env: PUPPET_LOCATION="~> 3.3.0" + - rvm: 2.4.5 + env: PUPPET_LOCATION="~> 5.5.0" global: - - PUBLISHER_LOGIN=bjvrielink + - PUBLISHER_LOGIN=abrader notifications: email: false + webhooks: + urls: + - 'https://webhooks.gitter.im/e/16f24db0492933fce79d' + on_success: change + on_failure: always + on_start: false diff --git a/Gemfile b/Gemfile index 43ab7a2..6e0d856 100644 --- a/Gemfile +++ b/Gemfile @@ -12,7 +12,7 @@ end group :test do gem 'rake' - gem 'puppet', *location_for(ENV['PUPPET_LOCATION'] || '~> 5.5.0') + gem 'puppet', *location_for(ENV['PUPPET_LOCATION'] || '~> 3.7.0') gem 'puppetlabs_spec_helper' gem 'webmock' gem 'vcr' From 0e0d8c981a716012cf089bca0979f15fbf90d4cf Mon Sep 17 00:00:00 2001 From: Bart-Jan Vrielink Date: Mon, 13 May 2019 16:22:53 +0200 Subject: [PATCH 8/9] Support sub-projects for webhook in Gitlab --- lib/puppet/provider/git_webhook/gitlab.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/puppet/provider/git_webhook/gitlab.rb b/lib/puppet/provider/git_webhook/gitlab.rb index 25919ba..7c1a871 100644 --- a/lib/puppet/provider/git_webhook/gitlab.rb +++ b/lib/puppet/provider/git_webhook/gitlab.rb @@ -101,7 +101,7 @@ def get_project_id raise(Puppet::Error, "gitlab_webhook::#{calling_method}: Must provide at least one of the following attributes: project_id or project_name") end - project_name = resource[:project_name].strip.sub('/','%2F') + project_name = resource[:project_name].strip.gsub('/','%2F') url = "#{gms_server}/api/#{api_version}/projects/#{project_name}" From 1c27ce0357e852316247476051fe15983e316ea9 Mon Sep 17 00:00:00 2001 From: Bart-Jan Vrielink Date: Thu, 18 Feb 2021 12:31:55 +0100 Subject: [PATCH 9/9] Bumped dependencies --- metadata.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/metadata.json b/metadata.json index b7c4082..9923562 100644 --- a/metadata.json +++ b/metadata.json @@ -82,13 +82,13 @@ "requirements": [ { "name": "puppet", - "version_requirement": ">= 3.4.3 < 6.0.0" + "version_requirement": ">= 3.4.3 < 7.0.0" } ], "dependencies": [ { "name": "puppetlabs/stdlib", - "version_requirement": ">=3.2.0 <6.0.0" + "version_requirement": ">=3.2.0 <7.0.0" } ] }