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>

23 changes: 23 additions & 0 deletions .devcontainer/devcontainer.json
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",
}
84 changes: 84 additions & 0 deletions .github/workflows/auto_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: "Auto release"

on:
workflow_dispatch:

env:
HONEYCOMB_WRITEKEY: 7f3c63a70eecc61d635917de46bea4e6
HONEYCOMB_DATASET: litmus tests
CHANGELOG_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
auto_release:
name: "Automatic release prep"
runs-on: ubuntu-20.04

steps:
- name: "Honeycomb: Start recording"
uses: puppetlabs/kvrhdn-gha-buildevents@pdk-templates-v1
with:
apikey: ${{ env.HONEYCOMB_WRITEKEY }}
dataset: ${{ env.HONEYCOMB_DATASET }}
job-status: ${{ job.status }}

- name: "Honeycomb: start first step"
run: |
echo STEP_ID="auto-release" >> $GITHUB_ENV
echo STEP_START=$(date +%s) >> $GITHUB_ENV
- name: "Checkout Source"
if: ${{ github.repository_owner == 'puppetlabs' }}
uses: actions/checkout@v2
with:
fetch-depth: 0
persist-credentials: false

- name: "PDK Release prep"
uses: docker://puppet/iac_release:ci
with:
args: 'release prep --force'
env:
CHANGELOG_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: "Get Version"
if: ${{ github.repository_owner == 'puppetlabs' }}
id: gv
run: |
echo "::set-output name=ver::$(jq --raw-output .version metadata.json)"
- name: "Commit changes"
if: ${{ github.repository_owner == 'puppetlabs' }}
run: |
git config --local user.email "${{ github.repository_owner }}@users.noreply.github.com"
git config --local user.name "GitHub Action"
git add .
git commit -m "Release prep v${{ steps.gv.outputs.ver }}"
- name: Create Pull Request
id: cpr
uses: puppetlabs/peter-evans-create-pull-request@v3
if: ${{ github.repository_owner == 'puppetlabs' }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "Release prep v${{ steps.gv.outputs.ver }}"
branch: "release-prep"
delete-branch: true
title: "Release prep v${{ steps.gv.outputs.ver }}"
body: |
Automated release-prep through [pdk-templates](https://github.com/puppetlabs/pdk-templates/blob/main/moduleroot/.github/workflows/auto_release.yml.erb) from commit ${{ github.sha }}.
Please verify before merging:
- [ ] last [nightly](https://github.com/${{ github.repository }}/actions/workflows/nightly.yml) run is green
- [ ] [Changelog](https://github.com/${{ github.repository }}/blob/release-prep/CHANGELOG.md) is readable and has no unlabeled pull requests
- [ ] Ensure the [changelog](https://github.com/${{ github.repository }}/blob/release-prep/CHANGELOG.md) version and [metadata](https://github.com/${{ github.repository }}/blob/release-prep/metadata.json) version match
labels: "maintenance"

- name: PR outputs
if: ${{ github.repository_owner == 'puppetlabs' }}
run: |
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
- name: "Honeycomb: Record finish step"
if: ${{ always() }}
run: |
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Finished auto release workflow'
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@ on:

jobs:
daily_unit_tests_with_nightly_puppet_gem:
name: ${{ matrix.os_type }} / Puppet${{ matrix.puppet_version }} gem / Ruby ${{ matrix.ruby }}
name: ${{ matrix.os_type }} / Puppet${{ matrix.puppet_version }} gem / Ruby ${{ matrix.ruby }}
strategy:
matrix:
os: [ 'ubuntu-18.04', 'macos-10.15', 'windows-2016' ]
puppet_version: [ 5, 6, 7 ]
puppet_version: [ 6, 7 ]
include:
- puppet_version: 5
ruby: 2.4
- puppet_version: 6
ruby: 2.5
- puppet_version: 7
Expand Down Expand Up @@ -50,7 +48,9 @@ jobs:
- name: Prepare testing environment with bundler
run: |
git config --global core.longpaths true
bundle config set system 'true'
bundle config set --local without 'release'
${{ matrix.env_set_cmd }}PUPPET_GEM_VERSION=$(ruby -e 'puts /puppet\s+\((.+)\)/.match(`gem list -eld puppet`)[1]')
bundle update --jobs 4 --retry 3
Expand Down
47 changes: 47 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: "Publish module"

on:
workflow_dispatch:

jobs:
create-github-release:
name: Deploy GitHub Release
runs-on: ubuntu-20.04
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: Create Release
uses: actions/create-release@v1
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: "v${{ steps.gv.outputs.ver }}"
draft: false
prerelease: false

deploy-forge:
name: Deploy to Forge
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
ref: ${{ github.ref }}
clean: true
- name: "PDK Build"
uses: docker://puppet/pdk:nightly
with:
args: 'build'
- name: "Push to Forge"
uses: docker://puppet/pdk:nightly
with:
args: 'release publish --forge-token ${{ secrets.FORGE_API_KEY }} --force'
7 changes: 5 additions & 2 deletions .github/workflows/static_code_analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
name: Run checks

env:
ruby_version: 2.5
ruby_version: 2.6
extra_checks: check:symlinks check:git_ignore check:dot_underscore check:test_file

runs-on: 'ubuntu-18.04'
Expand All @@ -28,7 +28,10 @@ jobs:
ruby-version: ${{ env.ruby_version }}

- name: Prepare testing environment with bundler
run: bundle update --jobs 4 --retry 3
run: |
git config --global core.longpaths true
bundle config set --local without 'release'
bundle update --jobs 4 --retry 3
- name: Run commits check
run: bundle exec rake commits
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/unit_tests_with_nightly_puppet_gem.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@ jobs:
strategy:
matrix:
os: [ 'ubuntu-18.04', 'macos-10.15', 'windows-2016' ]
puppet_version: [ 5, 6, 7 ]
puppet_version: [ 6, 7 ]
include:
- puppet_version: 5
ruby: 2.4
- puppet_version: 6
ruby: 2.5
- puppet_version: 7
Expand Down Expand Up @@ -52,7 +50,9 @@ jobs:
- name: Prepare testing environment with bundler
run: |
git config --global core.longpaths true
bundle config set system 'true'
bundle config set --local without 'release'
${{ matrix.env_set_cmd }}PUPPET_GEM_VERSION=$(ruby -e 'puts /puppet\s+\((.+)\)/.match(`gem list -eld puppet`)[1]')
bundle update --jobs 4 --retry 3
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/unit_tests_with_released_puppet_gem.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ on:

jobs:
unit_tests_with_released_puppet_gem:
name: ${{ matrix.os_type }} / Puppet${{ matrix.puppet_version }} gem / Ruby ${{ matrix.ruby }}
name: ${{ matrix.os_type }} / Puppet${{ matrix.puppet_version }} gem / Ruby ${{ matrix.ruby }}
strategy:
matrix:
os: [ 'ubuntu-18.04', 'macos-10.15', 'windows-2016' ]
puppet_version: [ 5, 6 ]
puppet_version: [ 6, 7 ]
include:
- puppet_version: 5
ruby: 2.4
- puppet_version: 6
ruby: 2.5
- puppet_version: 7
ruby: 2.7

- os: 'ubuntu-18.04'
os_type: 'Linux'
Expand All @@ -41,7 +41,9 @@ jobs:

- name: Prepare testing environment with bundler
run: |
git config --global core.longpaths true
bundle config set system 'true'
bundle config set --local without 'release'
bundle update --jobs 4 --retry 3
- name: Run unit tests
Expand Down
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,4 @@
.project
.envrc
/inventory.yaml
.rspec
appveyor.yml
/spec/fixtures/litmus_inventory.yaml
41 changes: 0 additions & 41 deletions .gitlab-ci.yml

This file was deleted.

5 changes: 5 additions & 0 deletions .pdkignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,16 @@
.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
Expand All @@ -40,3 +43,5 @@
/.yardopts
/spec/
/.vscode/
/.sync.yml
/.devcontainer/
Loading