Skip to content

Commit abb3817

Browse files
committed
Update pdk-templates for gitpod and codespaces support
1 parent b356a7f commit abb3817

12 files changed

+94
-10
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+
- [email protected]: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

+4
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,7 @@ Rakefile:
4949
spec/spec_helper.rb:
5050
mock_with: ":rspec"
5151
coverage_report: true
52+
.gitpod.Dockerfile:
53+
unmanaged: false
54+
.gitpod.yml:
55+
unmanaged: false

Gemfile

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ 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]

Rakefile

+6-7
Original file line numberDiff line numberDiff line change
@@ -53,36 +53,35 @@ if Bundler.rubygems.find_name('github_changelog_generator').any?
5353
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)."
5454
config.add_pr_wo_labels = true
5555
config.issues = false
56-
config.merge_prefix = "### UNCATEGORIZED PRS; GO LABEL THEM"
56+
config.merge_prefix = "### UNCATEGORIZED PRS; LABEL THEM ON GITHUB"
5757
config.configure_sections = {
5858
"Changed" => {
5959
"prefix" => "### Changed",
6060
"labels" => ["backwards-incompatible"],
6161
},
6262
"Added" => {
6363
"prefix" => "### Added",
64-
"labels" => ["feature", "enhancement"],
64+
"labels" => ["enhancement", "feature"],
6565
},
6666
"Fixed" => {
6767
"prefix" => "### Fixed",
68-
"labels" => ["bugfix"],
68+
"labels" => ["bug", "documentation", "bugfix"],
6969
},
7070
}
7171
end
7272
else
7373
desc 'Generate a Changelog from GitHub'
7474
task :changelog do
7575
raise <<EOM
76-
The changelog tasks depends on unreleased features of the github_changelog_generator gem.
76+
The changelog tasks depends on recent features of the github_changelog_generator gem.
7777
Please manually add it to your .sync.yml for now, and run `pdk update`:
7878
---
7979
Gemfile:
8080
optional:
8181
':development':
8282
- gem: 'github_changelog_generator'
83-
git: 'https://github.com/skywinder/github-changelog-generator'
84-
ref: '20ee04ba1234e9e83eb2ffb5056e23d641c7a018'
85-
condition: "Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.2.2')"
83+
version: '~> 1.15'
84+
condition: "Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.3.0')"
8685
EOM
8786
end
8887
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
@@ -81,7 +81,7 @@
8181
}
8282
],
8383
"description": "Module for Apache configuration",
84-
"pdk-version": "1.18.0",
84+
"pdk-version": "1.18.1",
8585
"template-url": "https://github.com/puppetlabs/pdk-templates#main",
86-
"template-ref": "heads/main-0-g9c14433"
86+
"template-ref": "heads/main-0-g874030e"
8787
}

0 commit comments

Comments
 (0)