forked from ploperations/ploperations-webhook_proxy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(maint) pdk and repo standards update
- Loading branch information
Heath Seals
committed
Jun 7, 2021
1 parent
cdf0439
commit 3ca3ec0
Showing
14 changed files
with
641 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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", | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
--fail-on-warnings | ||
--relative |
Oops, something went wrong.