]> review.fuel-infra Code Review - puppet-modules/puppetlabs-apt.git/commitdiff
Merge pull request #890 from luckyraul/patch-1
authorsheenaajay <sheena@puppet.com>
Mon, 9 Dec 2019 14:26:50 +0000 (14:26 +0000)
committerGitHub <noreply@github.com>
Mon, 9 Dec 2019 14:26:50 +0000 (14:26 +0000)
Adding a new parameter for dist

15 files changed:
.fixtures.yml
.gitignore
.pdkignore
.project [deleted file]
.rubocop.yml
.sync.yml
.travis.yml
Gemfile
REFERENCE.md
Rakefile
lib/puppet/type/apt_key.rb
manifests/key.pp
metadata.json
provision.yaml
spec/default_facts.yml

index 6c2bda86165760b348891830f322b7f160279054..2d55ecf65e655aac1b983440db5be70e0edebe5d 100644 (file)
@@ -1,11 +1,11 @@
 fixtures:
   repositories:
     "stdlib":
-      "repo": "git://github.com/puppetlabs/puppetlabs-stdlib.git"
+      "repo": "https://github.com/puppetlabs/puppetlabs-stdlib.git"
     "translate": 
       "repo": "https://github.com/puppetlabs/puppetlabs-translate"
-    facts: 'git://github.com/puppetlabs/puppetlabs-facts.git'
-    puppet_agent: 'git://github.com/puppetlabs/puppetlabs-puppet_agent.git'
-    provision: 'git://github.com/puppetlabs/provision.git'
+    facts: 'https://github.com/puppetlabs/puppetlabs-facts.git'
+    puppet_agent: 'https://github.com/puppetlabs/puppetlabs-puppet_agent.git'
+    provision: 'https://github.com/puppetlabs/provision.git'
   symlinks:
     "apt": "#{source_dir}"
index 3f4e2e84942fa912f14261ac2fcb152f1f1c130a..2767022cd600dd0eb9d85289e0af0fda19b3b2e6 100644 (file)
@@ -22,5 +22,6 @@
 /convert_report.txt
 /update_report.txt
 .DS_Store
+.project
 .envrc
 /inventory.yaml
index 54d2cda3ab0c538a2ec753012adb017765ced20a..e6215cd0cbfdfab41b9bb612a4d27a343b109f60 100644 (file)
@@ -22,6 +22,7 @@
 /convert_report.txt
 /update_report.txt
 .DS_Store
+.project
 .envrc
 /inventory.yaml
 /appveyor.yml
diff --git a/.project b/.project
deleted file mode 100644 (file)
index 102070e..0000000
--- a/.project
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-       <name>puppetlabs-apt</name>
-       <comment></comment>
-       <projects>
-       </projects>
-       <buildSpec>
-               <buildCommand>
-                       <name>com.puppetlabs.geppetto.pp.dsl.ui.modulefileBuilder</name>
-                       <arguments>
-                       </arguments>
-               </buildCommand>
-               <buildCommand>
-                       <name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
-                       <arguments>
-                       </arguments>
-               </buildCommand>
-       </buildSpec>
-       <natures>
-               <nature>com.puppetlabs.geppetto.pp.dsl.ui.puppetNature</nature>
-               <nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
-       </natures>
-</projectDescription>
index ee74e8cbb291de546018ba3ea02860c589902f2a..33688a79ec1d068a47484b3bd878a725a7bf9f93 100644 (file)
@@ -27,6 +27,7 @@ GetText/DecorateString:
   Description: We don't want to decorate test output.
   Exclude:
   - spec/**/*
+  Enabled: false
 RSpec/BeforeAfterAll:
   Description: Beware of using after(:all) as it may cause state to leak between tests.
     A necessary evil in acceptance testing.
@@ -89,6 +90,12 @@ Style/MethodCalledOnDoEndBlock:
   Enabled: true
 Style/StringMethods:
   Enabled: true
+GetText/DecorateFunctionMessage:
+  Enabled: false
+GetText/DecorateStringFormattingUsingInterpolation:
+  Enabled: false
+GetText/DecorateStringFormattingUsingPercent:
+  Enabled: false
 Layout/EndOfLine:
   Enabled: false
 Layout/IndentHeredoc:
index 516ddebd6d982faaf79b4535577955e93e507567..88dbcc69acc080e2cd09aa16708655a92fe3b746 100644 (file)
--- a/.sync.yml
+++ b/.sync.yml
@@ -1,68 +1,60 @@
 ---
-.gitignore:
-  required:
-    - ---.project
-
-.gitlab-ci.yml:
-  unmanaged: true
-
-.rubocop.yml:
-   default_configs:
-    inherit_from: .rubocop_todo.yml
+".gitlab-ci.yml":
+  delete: true
+".rubocop.yml":
+  default_configs:
+    inherit_from: ".rubocop_todo.yml"
     require:
-      - rubocop-i18n
-      - rubocop-rspec
-
-.travis.yml:
+    - rubocop-i18n
+    - rubocop-rspec
+".travis.yml":
+  deploy_to_forge:
+    enabled: false
   branches:
-    - release
+  - release
   includes:
-    -
-      bundler_args:
-      dist: trusty
-      env: PLATFORMS=deb_puppet5
-      rvm: 2.5.3
-      before_script:
-        - bundle exec rake 'litmus:provision_list[travis_deb]'
-        - bundle exec bolt command run 'apt-get install wget -y' --inventoryfile inventory.yaml --nodes='localhost*'
-        - bundle exec rake 'litmus:install_agent[puppet5]'
-        - bundle exec rake litmus:install_module
-      script:
-        - bundle exec rake litmus:acceptance:parallel
-      services: docker
-      stage: acceptance
-      sudo: required
-    -
-      bundler_args:
-      dist: trusty
-      env: PLATFORM=deb_puppet6
-      rvm: 2.5.3
-      before_script:
-        - bundle exec rake 'litmus:provision_list[travis_deb]'
-        - bundle exec bolt command run 'apt-get install wget -y' --inventoryfile inventory.yaml --nodes='localhost*'
-        - bundle exec rake 'litmus:install_agent[puppet6]'
-        - bundle exec rake litmus:install_module
-      script:
-        - bundle exec rake litmus:acceptance:parallel
-      services: docker
-      sudo: required
-
+  - bundler_args: 
+    dist: trusty
+    env: PLATFORMS=deb_puppet5
+    rvm: 2.5.3
+    before_script:
+    - bundle exec rake 'litmus:provision_list[travis_deb]'
+    - bundle exec bolt command run 'apt-get install wget -y' --inventoryfile inventory.yaml --nodes='localhost*'
+    - bundle exec rake 'litmus:install_agent[puppet5]'
+    - bundle exec rake litmus:install_module
+    script:
+    - bundle exec rake litmus:acceptance:parallel
+    services: docker
+    stage: acceptance
+    sudo: required
+  - bundler_args: 
+    dist: trusty
+    env: PLATFORM=deb_puppet6
+    rvm: 2.5.3
+    before_script:
+    - bundle exec rake 'litmus:provision_list[travis_deb]'
+    - bundle exec bolt command run 'apt-get install wget -y' --inventoryfile inventory.yaml --nodes='localhost*'
+    - bundle exec rake 'litmus:install_agent[puppet6]'
+    - bundle exec rake litmus:install_module
+    script:
+    - bundle exec rake litmus:acceptance:parallel
+    services: docker
+    sudo: required
+    stage: acceptance
+  simplecov: true
 appveyor.yml:
   delete: true
-
 Gemfile:
   optional:
-    ':development':
-      - gem: 'github_changelog_generator'
-        git: 'https://github.com/skywinder/github-changelog-generator'
-        ref: '20ee04ba1234e9e83eb2ffb5056e23d641c7a018'
-        condition: "Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.2.2')"
-      - gem: puppet-lint-i18n
-
+    ":development":
+    - gem: github_changelog_generator
+      git: https://github.com/skywinder/github-changelog-generator
+      ref: 20ee04ba1234e9e83eb2ffb5056e23d641c7a018
+      condition: Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.2.2')
+    - gem: puppet-lint-i18n
 Rakefile:
   requires:
-    - puppet_pot_generator/rake_tasks
-
+  - puppet_pot_generator/rake_tasks
 spec/spec_helper.rb:
-  mock_with: ':rspec'
+  mock_with: ":rspec"
   coverage_report: true
index 742370a7549ca5fabeaf3541fd34acef1afa383b..1fc720dc5c261c52b0f20466550ed0c69486c6d3 100644 (file)
@@ -9,7 +9,7 @@ before_install:
   - gem --version
   - bundle -v
 script:
-  - 'bundle exec rake $CHECK'
+  - 'SIMPLECOV=yes bundle exec rake $CHECK'
 bundler_args: --without system_tests
 rvm:
   - 2.5.3
@@ -17,9 +17,6 @@ stages:
   - static
   - spec
   - acceptance
-  -
-    if: tag =~ ^v\d
-    name: deploy
 matrix:
   fast_finish: true
   include:
@@ -34,9 +31,6 @@ matrix:
       env: PUPPET_GEM_VERSION="~> 6.0" CHECK=parallel_spec
       rvm: 2.5.3
       stage: spec
-    -
-      env: DEPLOY_TO_FORGE=yes
-      stage: deploy
     -
       before_script: ["bundle exec rake 'litmus:provision_list[travis_deb]'", "bundle exec bolt command run 'apt-get install wget -y' --inventoryfile inventory.yaml --nodes='localhost*'", "bundle exec rake 'litmus:install_agent[puppet5]'", "bundle exec rake litmus:install_module"]
       bundler_args: 
@@ -55,6 +49,7 @@ matrix:
       rvm: 2.5.3
       script: ["bundle exec rake litmus:acceptance:parallel"]
       services: docker
+      stage: acceptance
       sudo: required
 branches:
   only:
diff --git a/Gemfile b/Gemfile
index 97ba33d495b979dd0ccb95ee6c0d860cf853c3f3..61d5e692838fb8fa5a21b5e8e28af4c38d9a05a6 100644 (file)
--- a/Gemfile
+++ b/Gemfile
@@ -1,5 +1,4 @@
 source ENV['GEM_SOURCE'] || 'https://rubygems.org'
-gem 'pdk', git: 'https://github.com/puppetlabs/pdk.git', branch: 'master'
 
 def location_for(place_or_version, fake_version = nil)
   git_url_regex = %r{\A(?<url>(https?|git)[:@][^#]*)(#(?<branch>.*))?}
@@ -72,4 +71,4 @@ extra_gemfiles.each do |gemfile|
     eval(File.read(gemfile), binding)
   end
 end
-# vim: syntax=ruby
\ No newline at end of file
+# vim: syntax=ruby
index 0987e2739cd9a6fa20ef7dfdccb7fbfc790023d5..d9175d5581e7d3b9b3de324dbd9d02e2e8c24f76 100644 (file)
@@ -520,7 +520,7 @@ Default value: `undef`
 
 ##### `server`
 
-Data type: `Pattern[/\A((hkp|hkps|http|https):\/\/)?([a-z\d])([a-z\d-]{0,61}\.)+[a-z\d]+(:\d{2,5})?$/]`
+Data type: `Pattern[/\A((hkp|hkps|http|https):\/\/)?([a-z\d])([a-z\d-]{0,61}\.)+[a-z\d]+(:\d{2,5})?(\/[a-zA-Z\d\-_]+)*\/?$/]`
 
 Specifies a keyserver to provide the GPG key. Valid options: a string containing a domain name or a full URL (http://, https://,
 hkp:// or hkps://). The hkps:// protocol is currently only supported on Ubuntu 18.04.
index 13b58c86ddcc8d51fff1e19c957deab7f9565fd6..c45dfc8c07e5a74f8fe4536a32a0f503d7084b21 100644 (file)
--- a/Rakefile
+++ b/Rakefile
@@ -16,8 +16,17 @@ end
 
 def changelog_project
   return unless Rake.application.top_level_tasks.include? "changelog"
-  returnVal = nil || JSON.load(File.read('metadata.json'))['source'].match(%r{.*/([^/]*)})[1]
-  raise "unable to find the changelog_project in .sync.yml or the name in metadata.json" if returnVal.nil?
+
+  returnVal = nil
+  returnVal ||= begin
+    metadata_source = JSON.load(File.read('metadata.json'))['source']
+    metadata_source_match = metadata_source && metadata_source.match(%r{.*\/([^\/]*?)(?:\.git)?\Z})
+
+    metadata_source_match && metadata_source_match[1]
+  end
+
+  raise "unable to find the changelog_project in .sync.yml or calculate it from the source in metadata.json" if returnVal.nil?
+
   puts "GitHubChangelogGenerator project:#{returnVal}"
   returnVal
 end
index 8c5c84c886f83c3bc296b0e06e50ff73af3d1391..e543b96cb980a2d63bf197fddf2903e3b6ca5e54 100644 (file)
@@ -68,7 +68,7 @@ Puppet::Type.newtype(:apt_key) do
     desc 'The key server to fetch the key from based on the ID. It can either be a domain name or url.'
     defaultto :'keyserver.ubuntu.com'
 
-    newvalues(%r{\A((hkp|hkps|http|https)://)?([a-z\d])([a-z\d-]{0,61}\.)+[a-z\d]+(:\d{2,5})?$})
+    newvalues(%r{\A((hkp|hkps|http|https):\/\/)?([a-z\d])([a-z\d-]{0,61}\.)+[a-z\d]+(:\d{2,5})?(\/[a-zA-Z\d\-_]+)*\/?$})
   end
 
   newparam(:options) do
index 8ef3ef1f8158cd7e276dd807eb2a44b0316458e3..1ffdef1b18d60816d27598eabc0e77e04e1e45a7 100644 (file)
 #   Passes additional options to `apt-key adv --keyserver-options`.
 #
 define apt::key (
-  Pattern[/\A(0x)?[0-9a-fA-F]{8}\Z/, /\A(0x)?[0-9a-fA-F]{16}\Z/, /\A(0x)?[0-9a-fA-F]{40}\Z/] $id     = $title,
-  Enum['present', 'absent', 'refreshed'] $ensure                                                     = present,
-  Optional[String] $content                                                                          = undef,
-  Optional[Pattern[/\Ahttps?:\/\//, /\Aftp:\/\//, /\A\/\w+/]] $source                                = undef,
-  Pattern[/\A((hkp|hkps|http|https):\/\/)?([a-z\d])([a-z\d-]{0,61}\.)+[a-z\d]+(:\d{2,5})?$/] $server = $::apt::keyserver,
-  Boolean $weak_ssl                                                                                  = false,
-  Optional[String] $options                                                                          = $::apt::key_options,
+  Pattern[/\A(0x)?[0-9a-fA-F]{8}\Z/, /\A(0x)?[0-9a-fA-F]{16}\Z/, /\A(0x)?[0-9a-fA-F]{40}\Z/] $id                        = $title,
+  Enum['present', 'absent', 'refreshed'] $ensure                                                                        = present,
+  Optional[String] $content                                                                                             = undef,
+  Optional[Pattern[/\Ahttps?:\/\//, /\Aftp:\/\//, /\A\/\w+/]] $source                                                   = undef,
+  Pattern[/\A((hkp|hkps|http|https):\/\/)?([a-z\d])([a-z\d-]{0,61}\.)+[a-z\d]+(:\d{2,5})?(\/[a-zA-Z\d\-_]+)*\/?$/] $server = $::apt::keyserver,
+  Boolean $weak_ssl                                                                                                     = false,
+  Optional[String] $options                                                                                             = $::apt::key_options,
   ) {
 
   case $ensure {
index 19f0e8e23606686bb40eedc03329dde8a8c67e03..7fc5cc9175341d2d90097d0d09e8bde948562278 100644 (file)
@@ -29,7 +29,6 @@
     {
       "operatingsystem": "Ubuntu",
       "operatingsystemrelease": [
-        "14.04",
         "16.04",
         "18.04"
       ]
@@ -41,7 +40,7 @@
       "version_requirement": ">= 5.5.10 < 7.0.0"
     }
   ],
-  "template-url": "https://github.com/puppetlabs/pdk-templates/#master",
-  "template-ref": "1.12.0-0-g55d9ae2",
-  "pdk-version": "1.12.0"
+  "template-url": "https://github.com/puppetlabs/pdk-templates#master",
+  "template-ref": "heads/master-0-g643529a",
+  "pdk-version": "1.14.1"
 }
index 3fb28c0e3bd69140011643051479c054a021d7c4..00147dc9ed69cfc80414dcbd1216437b1c267ff7 100644 (file)
@@ -4,13 +4,13 @@ default:
   images: ['waffleimage/debian8']
 travis_deb:
   provisioner: docker
-  images: ['debian:8', 'debian:9', 'ubuntu:14.04', 'ubuntu:16.04', 'ubuntu:18.04']
+  images: ['debian:8', 'debian:9', 'ubuntu:16.04', 'ubuntu:18.04']
 waffle_deb:
   provisioner: docker 
-  images: ['waffleimage/debian8', 'waffleimage/debian9', 'waffleimage/ubuntu14.04', 'waffleimage/ubuntu16.04', 'waffleimage/ubuntu18.04']
+  images: ['waffleimage/debian8', 'waffleimage/debian9', 'waffleimage/ubuntu16.04', 'waffleimage/ubuntu18.04']
 vagrant:
   provisioner: vagrant
   images: ['centos/7', 'generic/ubuntu1804']
 release_checks:
   provisioner: vmpooler
-  images: ['debian-8-x86_64', 'debian-9-x86_64', 'debian-10-x86_64', 'ubuntu-1404-x86_64', 'ubuntu-1604-x86_64', 'ubuntu-1804-x86_64']
+  images: ['debian-8-x86_64', 'debian-9-x86_64', 'debian-10-x86_64', 'ubuntu-1604-x86_64', 'ubuntu-1804-x86_64']
index ea1e4808e3a67f50ea6d64d23a0eb8b3fd25437f..f777abfc9905202e7ccf5b5fcc76b9b4c59a39fb 100644 (file)
@@ -3,5 +3,6 @@
 # Facts specified here will override the values provided by rspec-puppet-facts.
 ---
 ipaddress: "172.16.254.254"
+ipaddress6: "FE80:0000:0000:0000:AAAA:AAAA:AAAA"
 is_pe: false
 macaddress: "AA:AA:AA:AA:AA:AA"