Skip to content

Commit 41d2aa8

Browse files
authored
Merge branch 'master' into feature/add-monitoring-disable-plan-for-prometheus
2 parents 0ac7d83 + 5150f8e commit 41d2aa8

7 files changed

Lines changed: 152 additions & 5 deletions

File tree

.github/workflows/build.yaml

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
name: build
2+
3+
on:
4+
push:
5+
branches: ['*']
6+
tags:
7+
- v*
8+
pull_request:
9+
type: [opened, reopened, edited]
10+
schedule:
11+
# run every night at midnight
12+
- cron: '0 0 * * *'
13+
14+
jobs:
15+
unit:
16+
name: '${{matrix.name}} - puppet (${{matrix.puppet}})'
17+
runs-on: ubuntu-latest
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
include:
22+
# note: actions/setup-ruby only allows using a major.minor release of ruby
23+
- ruby: '2.5'
24+
puppet: "6.0"
25+
check: "check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop syntax lint metadata_lint"
26+
name: 'static'
27+
- ruby: '2.4'
28+
puppet: "5.0"
29+
check: "parallel_spec"
30+
name: 'spec'
31+
- ruby: '2.5'
32+
puppet: "6.0"
33+
check: "parallel_spec"
34+
name: 'spec'
35+
env:
36+
CHECK: '${{ matrix.check }}'
37+
PUPPET_GEM_VERSION: '~> ${{ matrix.puppet }}'
38+
# lock to 2.1.0 because 2.2.0 is causing issues during builds
39+
BUNDLER_GEM_VERSION: '~> 2.1.0'
40+
steps:
41+
- name: Checkout repository
42+
uses: actions/checkout@v2
43+
- name: Setup Ruby
44+
uses: actions/setup-ruby@v1
45+
with:
46+
ruby-version: '${{ matrix.ruby }}'
47+
- name: Bundle prep
48+
run: |
49+
gem install bundler -v "$BUNDLER_GEM_VERSION"
50+
bundle -v
51+
rm -f Gemfile.lock
52+
# Update system gems if requested. This is useful to temporarily workaround troubles in the test runner"
53+
# See https://github.com/puppetlabs/pdk-templates/commit/705154d5c437796b821691b707156e1b056d244f for an example of how this was used"
54+
# Ignore exit code of SIGPIPE'd yes to not fail with shell's pipefail set"
55+
[ -z "$RUBYGEMS_VERSION" ] || (yes || true) | gem update --system $RUBYGEMS_VERSION
56+
gem --version
57+
bundle -v
58+
bundle config path vendor/bundle
59+
bundle config without 'system_tests'
60+
bundle lock
61+
# restore cache AFTER doing 'bundle lock' so that Gemfile.lock exists
62+
- uses: actions/cache@v2
63+
with:
64+
path: vendor/bundle
65+
key: ${{ runner.os }}-${{ matrix.puppet }}-${{ matrix.ruby }}-gems-test-${{ hashFiles('**/Gemfile.lock') }}
66+
restore-keys: |
67+
${{ runner.os }}-${{ matrix.puppet }}-${{ matrix.ruby }}-gems-test-
68+
- name: Bundle install
69+
run: |
70+
bundle install --jobs $(nproc) --retry 3
71+
- name: Test
72+
run: 'bundle exec rake $CHECK'
73+
74+
deploy:
75+
name: 'deploy to forge'
76+
needs: unit
77+
runs-on: ubuntu-latest
78+
# only run deploy on tags that start with 'v'
79+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
80+
# define a "strategy" here so we can use ruby/puppet as variables below
81+
strategy:
82+
fail-fast: false
83+
matrix:
84+
include:
85+
# note: actions/setup-ruby only allows using a major.minor release of ruby
86+
- ruby: '2.5'
87+
puppet: "6.0"
88+
env:
89+
PUPPET_GEM_VERSION: '~> ${{ matrix.puppet }}'
90+
# lock to 2.1.0 because 2.2.0 is causing issues during builds
91+
BUNDLER_GEM_VERSION: '~> 2.1.0'
92+
steps:
93+
- name: Checkout repository
94+
uses: actions/checkout@v2
95+
- name: Setup Ruby
96+
uses: actions/setup-ruby@v1
97+
with:
98+
ruby-version: '${{ matrix.ruby }}'
99+
- name: Bundle prep
100+
run: |
101+
gem install bundler -v "$BUNDLER_GEM_VERSION"
102+
bundle -v
103+
rm -f Gemfile.lock
104+
# Update system gems if requested. This is useful to temporarily workaround troubles in the test runner"
105+
# See https://github.com/puppetlabs/pdk-templates/commit/705154d5c437796b821691b707156e1b056d244f for an example of how this was used"
106+
# Ignore exit code of SIGPIPE'd yes to not fail with shell's pipefail set"
107+
[ -z "$RUBYGEMS_VERSION" ] || (yes || true) | gem update --system $RUBYGEMS_VERSION
108+
gem --version
109+
bundle -v
110+
bundle config path vendor/bundle
111+
bundle config without 'system_tests'
112+
bundle lock
113+
# restore cache AFTER doing 'bundle lock' so that Gemfile.lock exists
114+
- uses: actions/cache@v2
115+
with:
116+
path: vendor/bundle
117+
key: ${{ runner.os }}-${{ matrix.puppet }}-${{ matrix.ruby }}-gems-test-${{ hashFiles('**/Gemfile.lock') }}
118+
restore-keys: |
119+
${{ runner.os }}-${{ matrix.puppet }}-${{ matrix.ruby }}-gems-test-
120+
- name: Bundle install
121+
run: |
122+
bundle install --jobs $(nproc) --retry 3
123+
- name: Build and Deploy
124+
env:
125+
# TODO configure secrets here:
126+
# https://docs.github.com/en/free-pro-team@latest/actions/reference/encrypted-secrets
127+
BLACKSMITH_FORGE_USERNAME: '${{ secrets.PUPPET_FORGE_USERNAME }}'
128+
BLACKSMITH_FORGE_PASSWORD: '${{ secrets.PUPPET_FORGE_PASSWORD }}'
129+
run: |
130+
bundle exec rake module:build
131+
bundle exec rake module:push
132+

.sync.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ appveyor.yml:
1818
Gemfile:
1919
required:
2020
':development':
21+
- gem: 'puppet-blacksmith'
22+
version: '>= 5.0.0'
2123
- gem: 'puppet-lint-absolute_template_path'
2224
version: '>= 1.0.1'
2325
- gem: 'puppet-lint-alias-check'
@@ -52,8 +54,15 @@ Gemfile:
5254
# extras:
5355
# - "# exclude plans because puppet-syntax doesn't support them yet: https://github.com/voxpupuli/puppet-syntax/issues/95"
5456
# - 'PuppetSyntax.exclude_paths = ["plans/**/*", "vendor/**/*"]'
57+
spec/spec_helper.rb:
58+
mock_with: ':rspec'
5559
.travis.yml:
56-
deploy_to_forge:
57-
enabled: true
58-
user: encore
59-
secure: "dAqckSD7HGROLA3AMl7CT5Mrw1NLqYBMRUMlR44dNuuFcUfigdW0VnIQrwotip304zJ68bWNpN2xi9QBfB1MDa8tymEQ35apaxvltJlTdKazlMnukl8TVp5WvtTBrwziwMfb99JZFLNMuReqZh+JHkfQjyjtLAglEf+QtNgmOzcXihUMl1kbV5XnrGQ7UDbc65ReT3khTIfZu6iCXqY/3JHOHLBd+EYc01EfOA/JQb1V/gIAf0zNSum4LZ4HoWrPXjts+w8pigJcCM0jxwpBFAex3uKSOTGC2lUG/xTwZXKT8lXWqZlbpAoahDDuH3CsvAA9FnnWQoXGIwryeZ2W0IVwYJvOvYtoepyd3//Tsvtma6wJuzqxlggpVCcb7Pm9IKXiUCXMnbQ4HP6YR/Mk5yt/+1Xl2RwJCve4fII9mo8OG657JyOio8BO+mznGJiZ5fCpQwtt3J8nlhnP5fDumNiggfhh2pzzZmSRp/LlsmVyJvWwweNskbX69F1g6r2NvEmiFedLjAg2jeOcRI7YiOsNsXwn4F/87RG6rOKw469MIcH74Td6oYYgSjaOMnLz07ZqL8YNxTwXhH7kc1MB92J+0GYX0iM38WpJFr30o/fu+wJzitKBSiFB2fQ1av1akBGFrBMX1GQIAj6USMQSpcIvVcCzCNcSS9cNUqTw7gI="
60+
# we've converted over to GitHub actions
61+
unmanaged: true
62+
# .travis.yml:
63+
# deploy_to_forge:
64+
# enabled: true
65+
# user: encore
66+
# secure: "rSxtW5opNBOGqj0iWgLV2t9tWJvFgBRUVeH25Wi9XqVkl3O+Yki0xsBAkrtG4UXrtbkYm5plF8GnwbsahH6XA/91ydl6uQkI/Xhn7EbC2FXTeWdNadPc/kQWDkRxgJ1ChWscS6WRoWApTDWadjQCNMzl4CgzYHyz8H9YBHFa/isPxBdGmoZYJ3/qPPxdjUSexeLxZf8gxVTJHJwe5VJik0CQ1eOu31//WDXUo6Erm0OuivWC5C3OnnrezH3vW27mqp4MCr1Uv6kw7NETM6seEHQdDKl1itOcXpayOMlw/nxTVBas03M7CfCz3CC2d9qzWjb5J2KxSjwO3RJo/oX8MaTrJDQ+ydcPC9T6uO7dX/Wm9hzHTBah4MzzMHtHfNBCS8Rmpson8BCfZVolRaWRjBRwSB54H2jOgBvclqgR2skVWhuvpFKhxAhH2et5HdYf81L8TgW24tjfbBsf4hYSrqG/sM0yzt/cY4u0N4SVN+6P86DRuvbdTKH+KpAPRRtTgHw0i+3E9wce4XFs6B5JrSSjjHR3sWXdZMb8bVkugHJXyQgTQKf94aNyRfu5tt6174SaBBSOLLR+CDtb8MP1egYfCRXWqA2OQhNcB/2/XhrE01e5CGCj8jepJ8APHfwTLZWVPlHETQr1iFqYZsGjPMaoB1SR4hUN5BaZ2n0g77A="
67+
68+

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ group :development do
2828
gem "puppet-module-posix-dev-r#{minor_version}", '~> 0.4', require: false, platforms: [:ruby]
2929
gem "puppet-module-win-default-r#{minor_version}", '~> 0.4', require: false, platforms: [:mswin, :mingw, :x64_mingw]
3030
gem "puppet-module-win-dev-r#{minor_version}", '~> 0.4', require: false, platforms: [:mswin, :mingw, :x64_mingw]
31+
gem "puppet-blacksmith", '>= 5.0.0', require: false
3132
gem "puppet-lint-absolute_template_path", '>= 1.0.1', require: false
3233
gem "puppet-lint-alias-check", '>= 0.1.1', require: false
3334
gem "puppet-lint-classes_and_types_beginning_with_digits-check", '>= 0.1.2', require: false

bolt.yaml renamed to bolt-project.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Usage:
22
# bolt puppetfile install
33
# bolt plan run patching::available_updates
4+
name: patching
45

56
# paths are relative to this bolt.yaml file
67
modulepath: "./modules:./site-modules"

metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
"version_requirement": ">= 4.10.0 < 7.0.0"
8383
}
8484
],
85-
"pdk-version": "1.18.0",
85+
"pdk-version": "1.18.1",
8686
"template-url": "https://github.com/puppetlabs/pdk-templates#1.18.0",
8787
"template-ref": "tags/1.18.0-0-g095317c"
8888
}

spec/spec_helper.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# frozen_string_literal: true
22

3+
RSpec.configure do |c|
4+
c.mock_with :rspec
5+
end
6+
37
require 'puppetlabs_spec_helper/module_spec_helper'
48
require 'rspec-puppet-facts'
59

0 commit comments

Comments
 (0)