]> review.fuel-infra Code Review - puppet-modules/puppetlabs-firewall.git/commitdiff
Update pdk-templates for gitpod and codespaces support pdksync_gitpod
authorDavid Schmitt <david.schmitt@puppet.com>
Tue, 17 Nov 2020 21:22:26 +0000 (21:22 +0000)
committerDavid Schmitt <david.schmitt@puppet.com>
Wed, 18 Nov 2020 11:39:49 +0000 (11:39 +0000)
13 files changed:
.devcontainer/Dockerfile [new file with mode: 0644]
.devcontainer/devcontainer.json [new file with mode: 0644]
.gitpod.Dockerfile [new file with mode: 0644]
.gitpod.yml [new file with mode: 0644]
.pdkignore
.rubocop.yml
.sync.yml
.travis.yml
Gemfile
Rakefile
data/common.yaml [new file with mode: 0644]
hiera.yaml [new file with mode: 0644]
metadata.json

diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile
new file mode 100644 (file)
index 0000000..12ed4ff
--- /dev/null
@@ -0,0 +1,6 @@
+FROM puppet/pdk:latest
+
+# [Optional] Uncomment this section to install additional packages.
+# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
+#     && apt-get -y install --no-install-recommends <your-package-list-here>
+
diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json
new file mode 100644 (file)
index 0000000..f1a55dc
--- /dev/null
@@ -0,0 +1,23 @@
+// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
+// https://github.com/microsoft/vscode-dev-containers/tree/v0.140.1/containers/puppet
+{
+       "name": "Puppet Development Kit (Community)",
+       "dockerFile": "Dockerfile",
+
+       // Set *default* container specific settings.json values on container create.
+       "settings": {
+               "terminal.integrated.shell.linux": "/bin/bash"
+       },
+
+       // Add the IDs of extensions you want installed when the container is created.
+       "extensions": [
+               "puppet.puppet-vscode",
+               "rebornix.Ruby"
+       ]
+
+       // Use 'forwardPorts' to make a list of ports inside the container available locally.
+       // "forwardPorts": [],
+
+       // Use 'postCreateCommand' to run commands after the container is created.
+       // "postCreateCommand": "pdk --version",
+}
diff --git a/.gitpod.Dockerfile b/.gitpod.Dockerfile
new file mode 100644 (file)
index 0000000..0814c5e
--- /dev/null
@@ -0,0 +1,18 @@
+FROM gitpod/workspace-full
+RUN sudo wget https://apt.puppet.com/puppet-tools-release-bionic.deb && \
+    wget https://apt.puppetlabs.com/puppet6-release-bionic.deb && \
+    sudo dpkg -i puppet6-release-bionic.deb && \
+    sudo dpkg -i puppet-tools-release-bionic.deb && \
+    sudo apt-get update && \
+    sudo apt-get install -y pdk zsh puppet-agent && \
+    sudo apt-get clean && \
+    sudo rm -rf /var/lib/apt/lists/*
+RUN sudo usermod -s $(which zsh) gitpod && \
+    sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" && \
+    echo "plugins=(git gitignore github gem pip bundler python ruby docker docker-compose)" >> /home/gitpod/.zshrc && \
+    echo 'PATH="$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/opt/puppetlabs/bin:/opt/puppetlabs/puppet/bin"'  >> /home/gitpod/.zshrc && \
+    sudo /opt/puppetlabs/puppet/bin/gem install puppet-debugger hub -N && \
+    mkdir -p /home/gitpod/.config/puppet && \
+    /opt/puppetlabs/puppet/bin/ruby -r yaml -e "puts ({'disabled' => true}).to_yaml" > /home/gitpod/.config/puppet/analytics.yml
+RUN rm -f puppet6-release-bionic.deb  puppet-tools-release-bionic.deb
+ENTRYPOINT /usr/bin/zsh
diff --git a/.gitpod.yml b/.gitpod.yml
new file mode 100644 (file)
index 0000000..18406c5
--- /dev/null
@@ -0,0 +1,9 @@
+image:
+  file: .gitpod.Dockerfile
+
+tasks:
+  - init: pdk bundle install
+
+vscode:
+  extensions:
+    - puppet.puppet-vscode@1.0.0:oSzfTkDf6Cmc1jOjgW33VA==
index e6215cd0cbfdfab41b9bb612a4d27a343b109f60..254808c8f3d2e210222b89254bb66f4fb90f282c 100644 (file)
@@ -32,6 +32,7 @@
 /.gitignore
 /.gitlab-ci.yml
 /.pdkignore
+/.puppet-lint.rc
 /Rakefile
 /rakelib/
 /.rspec
@@ -40,3 +41,4 @@
 /.yardopts
 /spec/
 /.vscode/
+/.sync.yml
index 5307849e376e270f0305e6c7eed74e0b6f7a1242..858882d1a2c25039f833acb692609418c21abaa0 100644 (file)
@@ -43,7 +43,7 @@ Style/BlockDelimiters:
 Style/BracesAroundHashParameters:
   Description: Braces are required by Ruby 2.7. Cop removed from RuboCop v0.80.0.
     See https://github.com/rubocop-hq/rubocop/pull/7643
-  Enabled: true
+  Enabled: false
 Style/ClassAndModuleChildren:
   Description: Compact style reduces the required amount of indentation.
   EnforcedStyle: compact
index cdac38abc8c313dd54cfec695fe8c5b564eeb18e..0e6670d0a5b09c139b6ac929154fc72caf6682a7 100644 (file)
--- a/.sync.yml
+++ b/.sync.yml
@@ -2,6 +2,7 @@
 ".gitlab-ci.yml":
   delete: true
 ".travis.yml":
+  dist: trusty # acceptance tests have stopped working on newer versions - probably related to docker behaviour
   global_env: 
     - HONEYCOMB_WRITEKEY="7f3c63a70eecc61d635917de46bea4e6",HONEYCOMB_DATASET="litmus tests"
   deploy_to_forge:
@@ -41,3 +42,7 @@ Gemfile:
 spec/spec_helper.rb:
   mock_with: ":rspec"
   coverage_report: true
+.gitpod.Dockerfile:
+  unmanaged: false
+.gitpod.yml:
+  unmanaged: false
index 6338edd7bfa1b1269f50c36ad724f0f9ab16b4df..f9273b1638d95e750b5d9e74cba08c0aa4075f3e 100644 (file)
@@ -1,6 +1,6 @@
 ---
 os: linux
-dist: xenial
+dist: trusty
 language: ruby
 cache: bundler
 before_install:
@@ -33,7 +33,6 @@ jobs:
       - "bundle exec rake 'litmus:install_agent[puppet6]'"
       - "bundle exec rake litmus:install_module"
       bundler_args:
-      dist: trusty
       env: PLATFORMS=travis_ub_6_puppet6
       rvm: 2.5.7
       script: ["travis_wait 45 bundle exec rake litmus:acceptance:parallel"]
@@ -45,7 +44,6 @@ jobs:
       - "bundle exec rake 'litmus:install_agent[puppet5]'"
       - "bundle exec rake litmus:install_module"
       bundler_args:
-      dist: trusty
       env: PLATFORMS=travis_ub_5_puppet5
       rvm: 2.5.7
       script: ["travis_wait 45 bundle exec rake litmus:acceptance:parallel"]
@@ -57,7 +55,6 @@ jobs:
       - "bundle exec rake 'litmus:install_agent[puppet5]'"
       - "bundle exec rake litmus:install_module"
       bundler_args:
-      dist: trusty
       env: PLATFORMS=travis_deb_puppet5
       rvm: 2.5.7
       script: ["travis_wait 45 bundle exec rake litmus:acceptance:parallel"]
@@ -69,7 +66,6 @@ jobs:
       - "bundle exec rake 'litmus:install_agent[puppet5]'"
       - "bundle exec rake litmus:install_module"
       bundler_args:
-      dist: trusty
       env: PLATFORMS=travis_el7_puppet5
       rvm: 2.5.7
       script: ["travis_wait 45 bundle exec rake litmus:acceptance:parallel"]
@@ -81,7 +77,6 @@ jobs:
       - "bundle exec rake 'litmus:install_agent[puppet6]'"
       - "bundle exec rake litmus:install_module"
       bundler_args:
-      dist: trusty
       env: PLATFORMS=travis_deb_puppet6
       rvm: 2.5.7
       script: ["travis_wait 45 bundle exec rake litmus:acceptance:parallel"]
@@ -93,7 +88,6 @@ jobs:
       - "bundle exec rake 'litmus:install_agent[puppet6]'"
       - "bundle exec rake litmus:install_module"
       bundler_args:
-      dist: trusty
       env: PLATFORMS=travis_el7_puppet6
       rvm: 2.5.7
       script: ["travis_wait 45 bundle exec rake litmus:acceptance:parallel"]
diff --git a/Gemfile b/Gemfile
index adbbe6d0a419c8939aebd2e2500a82689f8e76a2..b6b25afe489cc09580bbb99d56fb5ce663d0da6b 100644 (file)
--- a/Gemfile
+++ b/Gemfile
@@ -23,14 +23,13 @@ group :development do
   gem "json", '= 1.8.1',                                         require: false if Gem::Version.new(RUBY_VERSION.dup) == Gem::Version.new('2.1.9')
   gem "json", '= 2.0.4',                                         require: false if Gem::Requirement.create('~> 2.4.2').satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
   gem "json", '= 2.1.0',                                         require: false if Gem::Requirement.create(['>= 2.5.0', '< 2.7.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
+  gem "json", '= 2.3.0',                                         require: false if Gem::Requirement.create(['>= 2.7.0', '< 2.8.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
   gem "rb-readline", '= 0.5.5',                                  require: false, platforms: [:mswin, :mingw, :x64_mingw]
   gem "puppet-module-posix-default-r#{minor_version}", '~> 0.4', require: false, platforms: [:ruby]
   gem "puppet-module-posix-dev-r#{minor_version}", '~> 0.4',     require: false, platforms: [:ruby]
   gem "puppet-module-win-default-r#{minor_version}", '~> 0.4',   require: false, platforms: [:mswin, :mingw, :x64_mingw]
   gem "puppet-module-win-dev-r#{minor_version}", '~> 0.4',       require: false, platforms: [:mswin, :mingw, :x64_mingw]
   gem "github_changelog_generator",                              require: false, git: 'https://github.com/skywinder/github-changelog-generator', ref: '20ee04ba1234e9e83eb2ffb5056e23d641c7a018' if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.2.2')
-  gem 'ed25519', '>= 1.2', '< 2.0'
-  gem 'bcrypt_pbkdf', '>= 1.0', '< 2.0'
 end
 
 puppet_version = ENV['PUPPET_GEM_VERSION']
index cb7ed0cc8fb24562a94cd918d90a50dc559bb00c..0a5093b33aaeac93cab8160f2f63988505061689 100644 (file)
--- a/Rakefile
+++ b/Rakefile
@@ -52,7 +52,7 @@ if Bundler.rubygems.find_name('github_changelog_generator').any?
     config.header = "# Change log\n\nAll notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org)."
     config.add_pr_wo_labels = true
     config.issues = false
-    config.merge_prefix = "### UNCATEGORIZED PRS; GO LABEL THEM"
+    config.merge_prefix = "### UNCATEGORIZED PRS; LABEL THEM ON GITHUB"
     config.configure_sections = {
       "Changed" => {
         "prefix" => "### Changed",
@@ -60,11 +60,11 @@ if Bundler.rubygems.find_name('github_changelog_generator').any?
       },
       "Added" => {
         "prefix" => "### Added",
-        "labels" => ["feature", "enhancement"],
+        "labels" => ["enhancement", "feature"],
       },
       "Fixed" => {
         "prefix" => "### Fixed",
-        "labels" => ["bugfix"],
+        "labels" => ["bug", "documentation", "bugfix"],
       },
     }
   end
@@ -72,16 +72,15 @@ else
   desc 'Generate a Changelog from GitHub'
   task :changelog do
     raise <<EOM
-The changelog tasks depends on unreleased features of the github_changelog_generator gem.
+The changelog tasks depends on recent features of the github_changelog_generator gem.
 Please manually add it to your .sync.yml for now, and run `pdk update`:
 ---
 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')"
+        version: '~> 1.15'
+        condition: "Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.3.0')"
 EOM
   end
 end
diff --git a/data/common.yaml b/data/common.yaml
new file mode 100644 (file)
index 0000000..2fbf0ff
--- /dev/null
@@ -0,0 +1 @@
+--- {}
diff --git a/hiera.yaml b/hiera.yaml
new file mode 100644 (file)
index 0000000..545fff3
--- /dev/null
@@ -0,0 +1,21 @@
+---
+version: 5
+
+defaults:  # Used for any hierarchy level that omits these keys.
+  datadir: data         # This path is relative to hiera.yaml's directory.
+  data_hash: yaml_data  # Use the built-in YAML backend.
+
+hierarchy:
+  - name: "osfamily/major release"
+    paths:
+        # Used to distinguish between Debian and Ubuntu
+      - "os/%{facts.os.name}/%{facts.os.release.major}.yaml"
+      - "os/%{facts.os.family}/%{facts.os.release.major}.yaml"
+        # Used for Solaris
+      - "os/%{facts.os.family}/%{facts.kernelrelease}.yaml"
+  - name: "osfamily"
+    paths:
+      - "os/%{facts.os.name}.yaml"
+      - "os/%{facts.os.family}.yaml"
+  - name: 'common'
+    path: 'common.yaml'
index 3c6944d15fe707133ab6cd497c034e6eb7da33ed..ab43e181d8bb21368b41af4139270ccb666652b6 100644 (file)
@@ -79,6 +79,6 @@
     }
   ],
   "template-url": "https://github.com/puppetlabs/pdk-templates#main",
-  "template-ref": "heads/main-0-g88b05c7",
-  "pdk-version": "1.17.0"
+  "template-ref": "heads/main-0-g874030e",
+  "pdk-version": "1.18.1"
 }