Skip to content

Commit 6613c7e

Browse files
committed
Update pdk-templates for gitpod and codespaces support
1 parent 8927af4 commit 6613c7e

11 files changed

+87
-2
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
@@ -50,3 +50,7 @@ Rakefile:
5050
spec/spec_helper.rb:
5151
mock_with: ":rspec"
5252
coverage_report: true
53+
.gitpod.Dockerfile:
54+
unmanaged: false
55+
.gitpod.yml:
56+
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]

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,6 @@
4343
}
4444
],
4545
"template-url": "https://github.com/puppetlabs/pdk-templates#main",
46-
"template-ref": "heads/main-0-gd610ead",
46+
"template-ref": "heads/main-0-g874030e",
4747
"pdk-version": "1.18.1"
4848
}

0 commit comments

Comments
 (0)