Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -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>

38 changes: 38 additions & 0 deletions .devcontainer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# devcontainer


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

``` json
{
"name": "Puppet Development Kit (Community)",
"dockerFile": "Dockerfile",

// Set *default* container specific settings.json values on container create.
"settings": {
"terminal.integrated.profiles.linux": {
"bash": {
"path": "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",
}
```



17 changes: 17 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "Puppet Development Kit (Community)",
"dockerFile": "Dockerfile",

"settings": {
"terminal.integrated.profiles.linux": {
"bash": {
"path": "bash"
}
}
},

"extensions": [
"puppet.puppet-vscode",
"rebornix.Ruby"
]
}
5 changes: 5 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*.rb eol=lf
*.erb eol=lf
*.pp eol=lf
*.sh eol=lf
*.epp eol=lf
28 changes: 28 additions & 0 deletions .github/workflows/pr_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: PR Testing

on:
- pull_request

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
puppet_versions:
- '6'
- '7'

name: Puppet ${{ matrix.puppet_versions }}
steps:
- uses: actions/checkout@v1
- name: Install the PDK
run: |
source /etc/os-release
wget https://apt.puppet.com/puppet-tools-release-${UBUNTU_CODENAME}.deb
sudo dpkg -i puppet-tools-release-${UBUNTU_CODENAME}.deb
sudo apt-get update
sudo apt-get install pdk
- name: Syntax validation
run: pdk validate --puppet-version ${{ matrix.puppet_versions }}
- name: Unit tests
run: pdk test unit --puppet-version ${{ matrix.puppet_versions }}
78 changes: 78 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Publish Module

on: workflow_dispatch

jobs:
publish-module:
name: Tag Release and Publish to Forge
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
ref: ${{ github.ref }}
clean: true
fetch-depth: 0
- name: Get Version
id: gv
run: |
echo "::set-output name=ver::$(jq --raw-output .version metadata.json)"
- name: Install the PDK
run: |
source /etc/os-release
wget https://apt.puppet.com/puppet-tools-release-${UBUNTU_CODENAME}.deb
sudo dpkg -i puppet-tools-release-${UBUNTU_CODENAME}.deb
rm -f puppet-tools-release-${UBUNTU_CODENAME}.deb
sudo apt-get update
sudo apt-get install pdk
pdk bundle install
- name: Validate Docs
run: |
set -e
documentation=$(pdk bundle exec puppet strings generate --format markdown)
if [ $(echo $documentation | grep -Ec "[1-9]+ undocumented|\[warn\]") -gt 0 ]; then
echo "Please resolve documentation issues detected below:"
echo "$documentation"
exit 1
fi
if output=$(git status --porcelain) && [ ! -z "$output" ]; then
echo "Here is the current git status:"
git status
echo
echo "The following changes were detected:"
git --no-pager diff
echo "Please submit a PR of changes after running 'pdk bundle exec puppet strings generate --format markdown'"
exit 1
fi
- name: Validate Changelog
env:
CHANGELOG_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -e
pdk bundle exec rake changelog
check_prs=$(grep -c '### UNCATEGORIZED PRS; LABEL THEM ON GITHUB' CHANGELOG.md) || echo "Check PRs success"
if [ $check_prs -gt 0 ]; then
echo "Uncategorized PRs found. Please address missing labels in the PRs below:"
git --no-pager diff CHANGELOG.md
exit 1
fi
if output=$(git status --porcelain) && [ ! -z "$output" ]; then
echo "Here is the current git status:"
git status
echo
echo "The following changes were detected:"
git --no-pager diff
echo "Uncommitted PRs found in the changelog. Please submit a PR of changes after running 'pdk bundle exec rake changelog'"
exit 1
fi
- name: Tag Release
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.gv.outputs.ver }}
token: ${{ secrets.GITHUB_TOKEN }}
draft: false
prerelease: false
- name: Build Module
run: pdk build
- name: Push to Forge
run: pdk release publish --forge-token ${{ secrets.FORGE_API_KEY }} --force
35 changes: 28 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,28 @@
.config
.vagrant

# log files
*.log

Gemfile.lock
.git/
.*.sw[op]
.metadata
.yardoc
.yardwarns
*.iml
/.bundle/
/.idea/
/.vagrant/
/coverage/
/bin/
/doc/
/Gemfile.local
/Gemfile.lock
/junit/
/log/
/pkg/
/spec/fixtures/manifests/
/spec/fixtures/modules/
/tmp/
/vendor/
/convert_report.txt
/update_report.txt
.DS_Store
.project
.envrc
/inventory.yaml
/spec/fixtures/litmus_inventory.yaml
46 changes: 46 additions & 0 deletions .pdkignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
.git/
.*.sw[op]
.metadata
.yardoc
.yardwarns
*.iml
/.bundle/
/.idea/
/.vagrant/
/coverage/
/bin/
/doc/
/Gemfile.local
/Gemfile.lock
/junit/
/log/
/pkg/
/spec/fixtures/manifests/
/spec/fixtures/modules/
/tmp/
/vendor/
/convert_report.txt
/update_report.txt
.DS_Store
.project
.envrc
/inventory.yaml
/spec/fixtures/litmus_inventory.yaml
/appveyor.yml
/.editorconfig
/.fixtures.yml
/Gemfile
/.gitattributes
/.gitignore
/.gitlab-ci.yml
/.pdkignore
/.puppet-lint.rc
/Rakefile
/rakelib/
/.rspec
/.rubocop.yml
/.yardopts
/spec/
/.vscode/
/.sync.yml
/.devcontainer/
2 changes: 2 additions & 0 deletions .puppet-lint.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
--fail-on-warnings
--relative
2 changes: 2 additions & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
--color
--format documentation
Loading