Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(MODULES-11371) Updates PDK template #39

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
38 changes: 38 additions & 0 deletions .devcontainer/README.md
@@ -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",
}
```



16 changes: 5 additions & 11 deletions .devcontainer/devcontainer.json
@@ -1,23 +1,17 @@
// 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"
"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",
}
18 changes: 12 additions & 6 deletions .github/workflows/auto_release.yml
Expand Up @@ -14,6 +14,7 @@ jobs:
runs-on: ubuntu-20.04

steps:

- name: "Honeycomb: Start recording"
uses: puppetlabs/kvrhdn-gha-buildevents@pdk-templates-v1
with:
Expand All @@ -25,10 +26,9 @@ jobs:
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
uses: actions/checkout@v3
with:
fetch-depth: 0
persist-credentials: false
Expand All @@ -46,8 +46,14 @@ jobs:
run: |
echo "::set-output name=ver::$(jq --raw-output .version metadata.json)"

- name: "Commit changes"
- name: "Check if a release is necessary"
if: ${{ github.repository_owner == 'puppetlabs' }}
id: check
run: |
git diff --quiet CHANGELOG.md && echo "::set-output name=release::false" || echo "::set-output name=release::true"

- name: "Commit changes"
if: ${{ github.repository_owner == 'puppetlabs' && steps.check.outputs.release == 'true' }}
run: |
git config --local user.email "${{ github.repository_owner }}@users.noreply.github.com"
git config --local user.name "GitHub Action"
Expand All @@ -57,7 +63,7 @@ jobs:
- name: Create Pull Request
id: cpr
uses: puppetlabs/peter-evans-create-pull-request@v3
if: ${{ github.repository_owner == 'puppetlabs' }}
if: ${{ github.repository_owner == 'puppetlabs' && steps.check.outputs.release == 'true' }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "Release prep v${{ steps.gv.outputs.ver }}"
Expand All @@ -73,11 +79,11 @@ jobs:
labels: "maintenance"

- name: PR outputs
if: ${{ github.repository_owner == 'puppetlabs' }}
if: ${{ github.repository_owner == 'puppetlabs' && steps.check.outputs.release == 'true' }}
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: |
Expand Down
Expand Up @@ -10,15 +10,15 @@ jobs:
name: ${{ matrix.os_type }} / Puppet${{ matrix.puppet_version }} gem / Ruby ${{ matrix.ruby }}
strategy:
matrix:
os: [ 'ubuntu-18.04', 'macos-latest', 'windows-2019' ]
os: [ 'ubuntu-20.04', 'macos-latest', 'windows-2019' ]
puppet_version: [ 6, 7 ]
include:
- puppet_version: 6
ruby: 2.5
- puppet_version: 7
ruby: 2.7

- os: 'ubuntu-18.04'
- os: 'ubuntu-20.04'
os_type: 'Linux'
env_set_cmd: 'export '
gem_file: 'puppet-latest.gem'
Expand All @@ -34,7 +34,7 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Install ruby version ${{ matrix.ruby }}
uses: ruby/setup-ruby@v1
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
ref: ${{ github.ref }}
clean: true
Expand All @@ -33,7 +33,7 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
ref: ${{ github.ref }}
clean: true
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/static_code_analysis.yaml
Expand Up @@ -15,10 +15,10 @@ jobs:
ruby_version: 2.6
extra_checks: check:symlinks check:git_ignore check:dot_underscore check:test_file

runs-on: 'ubuntu-18.04'
runs-on: 'ubuntu-20.04'
steps:
- name: Checkout current PR code
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/unit_tests_with_nightly_puppet_gem.yaml
Expand Up @@ -12,15 +12,15 @@ jobs:
name: ${{ matrix.os_type }} / Puppet${{ matrix.puppet_version }} gem / Ruby ${{ matrix.ruby }}
strategy:
matrix:
os: [ 'ubuntu-18.04', 'macos-latest', 'windows-2019' ]
os: [ 'ubuntu-20.04', 'macos-latest', 'windows-2019' ]
puppet_version: [ 6, 7 ]
include:
- puppet_version: 6
ruby: 2.5
- puppet_version: 7
ruby: 2.7

- os: 'ubuntu-18.04'
- os: 'ubuntu-20.04'
os_type: 'Linux'
env_set_cmd: 'export '
gem_file: 'puppet-latest.gem'
Expand All @@ -36,7 +36,7 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- name: Checkout current PR code
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Install ruby version ${{ matrix.ruby }}
uses: ruby/setup-ruby@v1
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/unit_tests_with_released_puppet_gem.yaml
Expand Up @@ -12,15 +12,15 @@ jobs:
name: ${{ matrix.os_type }} / Puppet${{ matrix.puppet_version }} gem / Ruby ${{ matrix.ruby }}
strategy:
matrix:
os: [ 'ubuntu-18.04', 'macos-latest', 'windows-2019' ]
os: [ 'ubuntu-20.04', 'macos-latest', 'windows-2019' ]
puppet_version: [ 6, 7 ]
include:
- puppet_version: 6
ruby: 2.5
- puppet_version: 7
ruby: 2.7

- os: 'ubuntu-18.04'
- os: 'ubuntu-20.04'
os_type: 'Linux'
- os: 'macos-latest'
os_type: 'macOS'
Expand All @@ -32,7 +32,7 @@ jobs:
PUPPET_GEM_VERSION: ~> ${{ matrix.puppet_version }}.0
steps:
- name: Checkout current PR code
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Install ruby version ${{ matrix.ruby }}
uses: ruby/setup-ruby@v1
Expand Down
2 changes: 1 addition & 1 deletion .rubocop.yml
Expand Up @@ -4,7 +4,7 @@ require:
- rubocop-rspec
AllCops:
DisplayCopNames: true
TargetRubyVersion: '2.4'
TargetRubyVersion: '2.5'
Include:
- "**/*.rb"
Exclude:
Expand Down
46 changes: 28 additions & 18 deletions Gemfile
Expand Up @@ -13,32 +13,42 @@ def location_for(place_or_version, fake_version = nil)
end
end

ruby_version_segments = Gem::Version.new(RUBY_VERSION.dup).segments
minor_version = ruby_version_segments[0..1].join('.')

group :development do
gem "json", '= 2.0.4', require: false if Gem::Requirement.create('~> 2.4.2').satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
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))
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))
gem "puppet-module-posix-default-r#{minor_version}", '~> 1.0', require: false, platforms: [:ruby]
gem "puppet-module-posix-dev-r#{minor_version}", '~> 1.0', require: false, platforms: [:ruby]
gem "puppet-module-win-default-r#{minor_version}", '~> 1.0', require: false, platforms: [:mswin, :mingw, :x64_mingw]
gem "puppet-module-win-dev-r#{minor_version}", '~> 1.0', require: false, platforms: [:mswin, :mingw, :x64_mingw]
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))
gem "json", '= 2.3.0', require: false if Gem::Requirement.create(['>= 2.7.0', '< 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
gem "json", '= 2.5.1', require: false if Gem::Requirement.create(['>= 3.0.0', '< 3.0.5']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
gem "json", '= 2.6.1', require: false if Gem::Requirement.create(['>= 3.1.0', '< 3.1.3']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
gem "json", '= 2.6.3', require: false if Gem::Requirement.create(['>= 3.2.0', '< 4.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
gem "voxpupuli-puppet-lint-plugins", '~> 3.1', require: false
gem "facterdb", '~> 1.18', require: false
gem "metadata-json-lint", '>= 2.0.2', '< 4.0.0', require: false
gem "puppetlabs_spec_helper", '>= 3.0.0', '< 5.0.0', require: false
gem "rspec-puppet-facts", '~> 2.0', require: false
gem "codecov", '~> 0.2', require: false
gem "dependency_checker", '~> 0.2', require: false
gem "parallel_tests", '~> 3.4', require: false
gem "pry", '~> 0.10', require: false
gem "simplecov-console", '~> 0.5', require: false
gem "puppet-debugger", '~> 1.0', require: false
gem "rubocop", '= 1.6.1', require: false
gem "rubocop-performance", '= 1.9.1', require: false
gem "rubocop-rspec", '= 2.0.1', require: false
gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw]
gem "beaker", *location_for(ENV['BEAKER_VERSION'] || '~> 4.30')
gem "beaker-abs", *location_for(ENV['BEAKER_ABS_VERSION'] || '~> 0.9')
gem "beaker-pe", require: false
gem "beaker-pe", require: false
gem "beaker-hostgenerator"
gem "beaker-rspec"
gem "beaker-puppet", *location_for(ENV['BEAKER_PUPPET_VERSION'] || '~> 1.22')
gem "github_changelog_generator", require: false
gem "async", '~> 1', require: false
gem "beaker-module_install_helper", require: false
gem "beaker-puppet_install_helper", require: false
gem "nokogiri", require: false
gem "github_changelog_generator", require: false
gem "async", '~> 1', require: false
gem "beaker-module_install_helper", require: false
gem "beaker-puppet_install_helper", require: false
gem "nokogiri", require: false
end
group :system_tests do
gem "puppet-module-posix-system-r#{minor_version}", '~> 1.0', require: false, platforms: [:ruby]
gem "puppet-module-win-system-r#{minor_version}", '~> 1.0', require: false, platforms: [:mswin, :mingw, :x64_mingw]
gem "puppet_litmus", '< 1.0.0', require: false, platforms: [:ruby]
gem "serverspec", '~> 2.41', require: false
end

puppet_version = ENV['PUPPET_GEM_VERSION']
Expand Down
1 change: 1 addition & 0 deletions Rakefile
Expand Up @@ -43,6 +43,7 @@ end

PuppetLint.configuration.send('disable_relative')


if Bundler.rubygems.find_name('github_changelog_generator').any?
GitHubChangelogGenerator::RakeTask.new :changelog do |config|
raise "Set CHANGELOG_GITHUB_TOKEN environment variable eg 'export CHANGELOG_GITHUB_TOKEN=valid_token_here'" if Rake.application.top_level_tasks.include? "changelog" and ENV['CHANGELOG_GITHUB_TOKEN'].nil?
Expand Down
8 changes: 4 additions & 4 deletions metadata.json
Expand Up @@ -21,10 +21,10 @@
"requirements": [
{
"name": "puppet",
"version_requirement": ">= 6.0.0 < 8.0.0"
"version_requirement": ">= 6.0.0 < 9.0.0"
}
],
"pdk-version": "2.3.0",
"template-url": "https://github.com/puppetlabs/pdk-templates#2.2.0",
"template-ref": "tags/2.2.0-0-g2381db6"
"pdk-version": "2.6.1",
"template-url": "https://github.com/puppetlabs/pdk-templates#2.7.1",
"template-ref": "tags/2.7.1-0-g9a16c87"
}