Skip to content

Commit

Permalink
Merge pull request #119 from voxpupuli/ci
Browse files Browse the repository at this point in the history
CI: Install Nomad 1.9.4
  • Loading branch information
bastelfreak authored Jan 9, 2025
2 parents 1227d5e + 33a6c20 commit 6640526
Show file tree
Hide file tree
Showing 15 changed files with 114 additions and 32 deletions.
12 changes: 10 additions & 2 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,15 +245,23 @@ with:
BEAKER_PUPPET_COLLECTION=puppet7 BEAKER_setfile=debian11-64 bundle exec rake beaker
```

or

```sh
BEAKER_PUPPET_COLLECTION=none BEAKER_setfile=archlinux-64 bundle exec rake beaker
```

This latter example will use the distribution's own version of Puppet.

You can replace the string `debian11` with any common operating system.
The following strings are known to work:

* ubuntu2004
* ubuntu2204
* debian11
* centos7
* centos8
* debian12
* centos9
* archlinux
* almalinux8
* almalinux9
* fedora36
Expand Down
5 changes: 3 additions & 2 deletions .rspec → .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
# Managed by modulesync - DO NOT EDIT
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/

--format documentation
--color
skip-changelog:
- head-branch: ['^release-*', 'release']
42 changes: 42 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
# Managed by modulesync - DO NOT EDIT
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/

# https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes

changelog:
exclude:
labels:
- duplicate
- invalid
- modulesync
- question
- skip-changelog
- wont-fix
- wontfix

categories:
- title: Breaking Changes 🛠
labels:
- backwards-incompatible

- title: New Features 🎉
labels:
- enhancement

- title: Bug Fixes 🐛
labels:
- bug

- title: Documentation Updates 📚
labels:
- documentation
- docs

- title: Dependency Updates ⬆️
labels:
- dependencies

- title: Other Changes
labels:
- "*"
5 changes: 2 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

name: CI

# yamllint disable-line rule:truthy
on:
pull_request: {}
push:
Expand All @@ -18,6 +19,4 @@ concurrency:
jobs:
puppet:
name: Puppet
uses: voxpupuli/gha-puppet/.github/workflows/beaker.yml@v2
with:
pidfile_workaround: 'false'
uses: voxpupuli/gha-puppet/.github/workflows/beaker.yml@v3
18 changes: 18 additions & 0 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
# Managed by modulesync - DO NOT EDIT
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/

name: "Pull Request Labeler"

# yamllint disable-line rule:truthy
on:
pull_request_target: {}

jobs:
labeler:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v5
10 changes: 9 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

name: Release

# yamllint disable-line rule:truthy
on:
push:
tags:
Expand All @@ -12,11 +13,18 @@ on:
jobs:
release:
name: Release
uses: voxpupuli/gha-puppet/.github/workflows/release.yml@v2
uses: voxpupuli/gha-puppet/.github/workflows/release.yml@v3
with:
allowed_owner: 'voxpupuli'
secrets:
# Configure secrets here:
# https://docs.github.com/en/actions/security-guides/encrypted-secrets
username: ${{ secrets.PUPPET_FORGE_USERNAME }}
api_key: ${{ secrets.PUPPET_FORGE_API_KEY }}

create-github-release:
name: Create GitHub Release
runs-on: ubuntu-latest
steps:
- name: Create GitHub release
uses: voxpupuli/gha-create-a-github-release@v1
2 changes: 1 addition & 1 deletion .msync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# Managed by modulesync - DO NOT EDIT
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/

modulesync_config_version: '7.5.0'
modulesync_config_version: '9.3.0'
8 changes: 5 additions & 3 deletions .overcommit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,12 @@ PreCommit:
enabled: true
description: 'Runs rubocop on modified files only'
command: ['bundle', 'exec', 'rubocop']
PuppetLint:
RakeTarget:
enabled: true
description: 'Runs puppet-lint on modified files only'
command: ['bundle', 'exec', 'puppet-lint']
description: 'Runs lint on modified files only'
targets:
- 'lint'
command: ['bundle', 'exec', 'rake']
YamlSyntax:
enabled: true
JsonSyntax:
Expand Down
1 change: 1 addition & 0 deletions .pmtignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
/.github/
/.librarian/
/Puppetfile.lock
/Puppetfile
*.iml
/.editorconfig
/.fixtures.yml
Expand Down
3 changes: 3 additions & 0 deletions .puppet-lint.rc
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Managed by modulesync - DO NOT EDIT
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/

--fail-on-warnings
--no-parameter_documentation-check
--no-parameter_types-check
4 changes: 0 additions & 4 deletions .rspec_parallel

This file was deleted.

6 changes: 3 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
source ENV['GEM_SOURCE'] || 'https://rubygems.org'

group :test do
gem 'voxpupuli-test', '~> 7.0', :require => false
gem 'voxpupuli-test', '~> 9.0', :require => false
gem 'coveralls', :require => false
gem 'simplecov-console', :require => false
gem 'puppet_metadata', '~> 3.5', :require => false
gem 'puppet_metadata', '~> 4.0', :require => false
gem 'puppet-lint-param-docs', :require => false
end

Expand All @@ -27,7 +27,7 @@ end
gem 'rake', :require => false
gem 'facter', ENV['FACTER_GEM_VERSION'], :require => false, :groups => [:test]

puppetversion = ENV['PUPPET_GEM_VERSION'] || '~> 7.24'
puppetversion = ENV['PUPPET_GEM_VERSION'] || [">= 7.24", "< 9"]
gem 'puppet', puppetversion, :require => false, :groups => [:test]

# vim: syntax=ruby
10 changes: 5 additions & 5 deletions spec/acceptance/url_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
pp = <<-EOS
class { 'nomad':
install_method => 'url',
version => '1.0.3',
version => '1.9.4',
config_hash => {
region => 'us-west',
datacenter => 'ptk',
Expand All @@ -29,17 +29,17 @@ class { 'nomad':
apply_manifest(pp, catch_changes: true)
end

describe file('/var/lib/nomad') && file('/opt/puppet-archive/nomad-1.0.3') do
describe file('/var/lib/nomad') && file('/opt/puppet-archive/nomad-1.9.4') do
it { is_expected.to be_directory }
end

describe file('/opt/puppet-archive/nomad-1.0.3/nomad') do
describe file('/opt/puppet-archive/nomad-1.9.4/nomad') do
it { is_expected.to be_file }
end

describe file('/usr/bin/nomad') do
it { is_expected.to be_symlink }
it { is_expected.to be_linked_to '/opt/puppet-archive/nomad-1.0.3/nomad' }
it { is_expected.to be_linked_to '/opt/puppet-archive/nomad-1.9.4/nomad' }
end

describe service('nomad') do
Expand All @@ -48,7 +48,7 @@ class { 'nomad':
end

describe command('nomad version') do
its(:stdout) { is_expected.to match(%r{Nomad v1\.0\.3}) }
its(:stdout) { is_expected.to match(%r{Nomad v1\.9\.4}) }
end
end
end
16 changes: 8 additions & 8 deletions spec/classes/init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
{
install_method: 'url',
manage_service_file: true,
version: '1.0.3'
version: '1.9.4'
}
end

Expand Down Expand Up @@ -92,7 +92,7 @@
{
install_method: 'url',
manage_service_file: true,
version: '1.0.3',
version: '1.9.4',
manage_repo: true
}
end
Expand Down Expand Up @@ -151,13 +151,13 @@
let(:params) do
{
install_method: 'url',
version: '1.0.3'
version: '1.9.4'
}
end

it { is_expected.to contain_archive('/opt/puppet-archive/nomad-1.0.3.zip').with(source: 'https://releases.hashicorp.com/nomad/1.0.3/nomad_1.0.3_linux_amd64.zip') }
it { is_expected.to contain_archive('/opt/puppet-archive/nomad-1.9.4.zip').with(source: 'https://releases.hashicorp.com/nomad/1.9.4/nomad_1.9.4_linux_amd64.zip') }
it { is_expected.to contain_file('/opt/puppet-archive').with(ensure: 'directory') }
it { is_expected.to contain_file('/opt/puppet-archive/nomad-1.0.3').with(ensure: 'directory') }
it { is_expected.to contain_file('/opt/puppet-archive/nomad-1.9.4').with(ensure: 'directory') }
it { is_expected.to contain_file('/usr/bin/nomad').that_notifies(['Class[nomad::run_service]']) }
end

Expand All @@ -178,11 +178,11 @@
{
install_method: 'url',
download_url: 'http://myurl',
version: '1.0.3',
version: '1.9.4',
}
end

it { is_expected.to contain_archive('/opt/puppet-archive/nomad-1.0.3.zip').with(source: 'http://myurl') }
it { is_expected.to contain_archive('/opt/puppet-archive/nomad-1.9.4.zip').with(source: 'http://myurl') }
it { is_expected.to contain_file('/usr/bin/nomad').that_notifies(['Class[nomad::run_service]']) }
end

Expand All @@ -194,7 +194,7 @@
end

it { is_expected.not_to contain_package('nomad') }
it { is_expected.not_to contain_archive('/opt/puppet-archive/nomad-1.0.3.zip') }
it { is_expected.not_to contain_archive('/opt/puppet-archive/nomad-1.9.4.zip') }
end

context 'When data_dir is provided' do
Expand Down
4 changes: 4 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@

require 'voxpupuli/test/spec_helper'

RSpec.configure do |c|
c.facterdb_string_keys = false
end

add_mocked_facts!

if File.exist?(File.join(__dir__, 'default_module_facts.yml'))
Expand Down

0 comments on commit 6640526

Please sign in to comment.