Skip to content

Commit ee2422e

Browse files
committed
Update pdk-templates for gitpod and codespaces support
1 parent f2a82d7 commit ee2422e

13 files changed

+96
-19
lines changed

.devcontainer/Dockerfile

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
FROM puppet/pdk:latest
2+
3+
# [Optional] Uncomment this section to install additional packages.
4+
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
5+
# && apt-get -y install --no-install-recommends <your-package-list-here>
6+

.devcontainer/devcontainer.json

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
2+
// https://github.com/microsoft/vscode-dev-containers/tree/v0.140.1/containers/puppet
3+
{
4+
"name": "Puppet Development Kit (Community)",
5+
"dockerFile": "Dockerfile",
6+
7+
// Set *default* container specific settings.json values on container create.
8+
"settings": {
9+
"terminal.integrated.shell.linux": "/bin/bash"
10+
},
11+
12+
// Add the IDs of extensions you want installed when the container is created.
13+
"extensions": [
14+
"puppet.puppet-vscode",
15+
"rebornix.Ruby"
16+
]
17+
18+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
19+
// "forwardPorts": [],
20+
21+
// Use 'postCreateCommand' to run commands after the container is created.
22+
// "postCreateCommand": "pdk --version",
23+
}

.gitpod.Dockerfile

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
FROM gitpod/workspace-full
2+
RUN sudo wget https://apt.puppet.com/puppet-tools-release-bionic.deb && \
3+
wget https://apt.puppetlabs.com/puppet6-release-bionic.deb && \
4+
sudo dpkg -i puppet6-release-bionic.deb && \
5+
sudo dpkg -i puppet-tools-release-bionic.deb && \
6+
sudo apt-get update && \
7+
sudo apt-get install -y pdk zsh puppet-agent && \
8+
sudo apt-get clean && \
9+
sudo rm -rf /var/lib/apt/lists/*
10+
RUN sudo usermod -s $(which zsh) gitpod && \
11+
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" && \
12+
echo "plugins=(git gitignore github gem pip bundler python ruby docker docker-compose)" >> /home/gitpod/.zshrc && \
13+
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 && \
14+
sudo /opt/puppetlabs/puppet/bin/gem install puppet-debugger hub -N && \
15+
mkdir -p /home/gitpod/.config/puppet && \
16+
/opt/puppetlabs/puppet/bin/ruby -r yaml -e "puts ({'disabled' => true}).to_yaml" > /home/gitpod/.config/puppet/analytics.yml
17+
RUN rm -f puppet6-release-bionic.deb puppet-tools-release-bionic.deb
18+
ENTRYPOINT /usr/bin/zsh

.gitpod.yml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
image:
2+
file: .gitpod.Dockerfile
3+
4+
tasks:
5+
- init: pdk bundle install
6+
7+
vscode:
8+
extensions:
9+
- puppet.puppet-vscode@1.0.0:oSzfTkDf6Cmc1jOjgW33VA==

.pdkignore

+2
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
/.gitignore
3333
/.gitlab-ci.yml
3434
/.pdkignore
35+
/.puppet-lint.rc
3536
/Rakefile
3637
/rakelib/
3738
/.rspec
@@ -40,3 +41,4 @@
4041
/.yardopts
4142
/spec/
4243
/.vscode/
44+
/.sync.yml

.rubocop.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Style/BlockDelimiters:
4343
Style/BracesAroundHashParameters:
4444
Description: Braces are required by Ruby 2.7. Cop removed from RuboCop v0.80.0.
4545
See https://github.com/rubocop-hq/rubocop/pull/7643
46-
Enabled: true
46+
Enabled: false
4747
Style/ClassAndModuleChildren:
4848
Description: Compact style reduces the required amount of indentation.
4949
EnforcedStyle: compact

.sync.yml

+5
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
".gitlab-ci.yml":
33
delete: true
44
".travis.yml":
5+
dist: trusty # acceptance tests have stopped working on newer versions - probably related to docker behaviour
56
global_env:
67
- HONEYCOMB_WRITEKEY="7f3c63a70eecc61d635917de46bea4e6",HONEYCOMB_DATASET="litmus tests"
78
deploy_to_forge:
@@ -41,3 +42,7 @@ Gemfile:
4142
spec/spec_helper.rb:
4243
mock_with: ":rspec"
4344
coverage_report: true
45+
.gitpod.Dockerfile:
46+
unmanaged: false
47+
.gitpod.yml:
48+
unmanaged: false

.travis.yml

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
os: linux
3-
dist: xenial
3+
dist: trusty
44
language: ruby
55
cache: bundler
66
before_install:
@@ -33,7 +33,6 @@ jobs:
3333
- "bundle exec rake 'litmus:install_agent[puppet6]'"
3434
- "bundle exec rake litmus:install_module"
3535
bundler_args:
36-
dist: trusty
3736
env: PLATFORMS=travis_ub_6_puppet6
3837
rvm: 2.5.7
3938
script: ["travis_wait 45 bundle exec rake litmus:acceptance:parallel"]
@@ -45,7 +44,6 @@ jobs:
4544
- "bundle exec rake 'litmus:install_agent[puppet5]'"
4645
- "bundle exec rake litmus:install_module"
4746
bundler_args:
48-
dist: trusty
4947
env: PLATFORMS=travis_ub_5_puppet5
5048
rvm: 2.5.7
5149
script: ["travis_wait 45 bundle exec rake litmus:acceptance:parallel"]
@@ -57,7 +55,6 @@ jobs:
5755
- "bundle exec rake 'litmus:install_agent[puppet5]'"
5856
- "bundle exec rake litmus:install_module"
5957
bundler_args:
60-
dist: trusty
6158
env: PLATFORMS=travis_deb_puppet5
6259
rvm: 2.5.7
6360
script: ["travis_wait 45 bundle exec rake litmus:acceptance:parallel"]
@@ -69,7 +66,6 @@ jobs:
6966
- "bundle exec rake 'litmus:install_agent[puppet5]'"
7067
- "bundle exec rake litmus:install_module"
7168
bundler_args:
72-
dist: trusty
7369
env: PLATFORMS=travis_el7_puppet5
7470
rvm: 2.5.7
7571
script: ["travis_wait 45 bundle exec rake litmus:acceptance:parallel"]
@@ -81,7 +77,6 @@ jobs:
8177
- "bundle exec rake 'litmus:install_agent[puppet6]'"
8278
- "bundle exec rake litmus:install_module"
8379
bundler_args:
84-
dist: trusty
8580
env: PLATFORMS=travis_deb_puppet6
8681
rvm: 2.5.7
8782
script: ["travis_wait 45 bundle exec rake litmus:acceptance:parallel"]
@@ -93,7 +88,6 @@ jobs:
9388
- "bundle exec rake 'litmus:install_agent[puppet6]'"
9489
- "bundle exec rake litmus:install_module"
9590
bundler_args:
96-
dist: trusty
9791
env: PLATFORMS=travis_el7_puppet6
9892
rvm: 2.5.7
9993
script: ["travis_wait 45 bundle exec rake litmus:acceptance:parallel"]

Gemfile

+1-2
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,13 @@ group :development do
2323
gem "json", '= 1.8.1', require: false if Gem::Version.new(RUBY_VERSION.dup) == Gem::Version.new('2.1.9')
2424
gem "json", '= 2.0.4', require: false if Gem::Requirement.create('~> 2.4.2').satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
2525
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))
26+
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))
2627
gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw]
2728
gem "puppet-module-posix-default-r#{minor_version}", '~> 0.4', require: false, platforms: [:ruby]
2829
gem "puppet-module-posix-dev-r#{minor_version}", '~> 0.4', require: false, platforms: [:ruby]
2930
gem "puppet-module-win-default-r#{minor_version}", '~> 0.4', require: false, platforms: [:mswin, :mingw, :x64_mingw]
3031
gem "puppet-module-win-dev-r#{minor_version}", '~> 0.4', require: false, platforms: [:mswin, :mingw, :x64_mingw]
3132
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')
32-
gem 'ed25519', '>= 1.2', '< 2.0'
33-
gem 'bcrypt_pbkdf', '>= 1.0', '< 2.0'
3433
end
3534

3635
puppet_version = ENV['PUPPET_GEM_VERSION']

Rakefile

+6-7
Original file line numberDiff line numberDiff line change
@@ -52,36 +52,35 @@ if Bundler.rubygems.find_name('github_changelog_generator').any?
5252
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)."
5353
config.add_pr_wo_labels = true
5454
config.issues = false
55-
config.merge_prefix = "### UNCATEGORIZED PRS; GO LABEL THEM"
55+
config.merge_prefix = "### UNCATEGORIZED PRS; LABEL THEM ON GITHUB"
5656
config.configure_sections = {
5757
"Changed" => {
5858
"prefix" => "### Changed",
5959
"labels" => ["backwards-incompatible"],
6060
},
6161
"Added" => {
6262
"prefix" => "### Added",
63-
"labels" => ["feature", "enhancement"],
63+
"labels" => ["enhancement", "feature"],
6464
},
6565
"Fixed" => {
6666
"prefix" => "### Fixed",
67-
"labels" => ["bugfix"],
67+
"labels" => ["bug", "documentation", "bugfix"],
6868
},
6969
}
7070
end
7171
else
7272
desc 'Generate a Changelog from GitHub'
7373
task :changelog do
7474
raise <<EOM
75-
The changelog tasks depends on unreleased features of the github_changelog_generator gem.
75+
The changelog tasks depends on recent features of the github_changelog_generator gem.
7676
Please manually add it to your .sync.yml for now, and run `pdk update`:
7777
---
7878
Gemfile:
7979
optional:
8080
':development':
8181
- gem: 'github_changelog_generator'
82-
git: 'https://github.com/skywinder/github-changelog-generator'
83-
ref: '20ee04ba1234e9e83eb2ffb5056e23d641c7a018'
84-
condition: "Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.2.2')"
82+
version: '~> 1.15'
83+
condition: "Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.3.0')"
8584
EOM
8685
end
8786
end

data/common.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--- {}

hiera.yaml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
version: 5
3+
4+
defaults: # Used for any hierarchy level that omits these keys.
5+
datadir: data # This path is relative to hiera.yaml's directory.
6+
data_hash: yaml_data # Use the built-in YAML backend.
7+
8+
hierarchy:
9+
- name: "osfamily/major release"
10+
paths:
11+
# Used to distinguish between Debian and Ubuntu
12+
- "os/%{facts.os.name}/%{facts.os.release.major}.yaml"
13+
- "os/%{facts.os.family}/%{facts.os.release.major}.yaml"
14+
# Used for Solaris
15+
- "os/%{facts.os.family}/%{facts.kernelrelease}.yaml"
16+
- name: "osfamily"
17+
paths:
18+
- "os/%{facts.os.name}.yaml"
19+
- "os/%{facts.os.family}.yaml"
20+
- name: 'common'
21+
path: 'common.yaml'

metadata.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,6 @@
7979
}
8080
],
8181
"template-url": "https://github.com/puppetlabs/pdk-templates#main",
82-
"template-ref": "heads/main-0-g88b05c7",
83-
"pdk-version": "1.17.0"
82+
"template-ref": "heads/main-0-g874030e",
83+
"pdk-version": "1.18.1"
8484
}

0 commit comments

Comments
 (0)