Skip to content

Commit d17ee5d

Browse files
committed
Use PDK
1 parent 6f3bba6 commit d17ee5d

26 files changed

+573
-182
lines changed

.gitattributes

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
*.rb eol=lf
2+
*.erb eol=lf
3+
*.pp eol=lf
4+
*.sh eol=lf
5+
*.epp eol=lf

.gitignore

+27-26
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,27 @@
1-
# IDE related
2-
.idea/
3-
.project/
4-
5-
# Testing and development
6-
.vagrant/
7-
spec/fixtures/modules/
8-
spec/fixtures/manifests/
9-
.rspec_system/
10-
.vagrant/
11-
/log
12-
13-
# Ruby and RVM
14-
.ruby-version
15-
.rvmrc
16-
17-
# Bundler
18-
Gemfile.lock
19-
.bundle/
20-
21-
# Puppet module generated
22-
pkg/
23-
24-
# Docs
25-
doc/
26-
.yardoc/
1+
.git/
2+
.*.sw[op]
3+
.metadata
4+
.yardoc
5+
.yardwarns
6+
*.iml
7+
/.bundle/
8+
/.idea/
9+
/.vagrant/
10+
/coverage/
11+
/bin/
12+
/doc/
13+
/Gemfile.local
14+
/Gemfile.lock
15+
/junit/
16+
/log/
17+
/pkg/
18+
/spec/fixtures/manifests/
19+
/spec/fixtures/modules/
20+
/tmp/
21+
/vendor/
22+
/convert_report.txt
23+
/update_report.txt
24+
.DS_Store
25+
.project
26+
.envrc
27+
/inventory.yaml

.pdkignore

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
.git/
2+
.*.sw[op]
3+
.metadata
4+
.yardoc
5+
.yardwarns
6+
*.iml
7+
/.bundle/
8+
/.idea/
9+
/.vagrant/
10+
/coverage/
11+
/bin/
12+
/doc/
13+
/Gemfile.local
14+
/Gemfile.lock
15+
/junit/
16+
/log/
17+
/pkg/
18+
/spec/fixtures/manifests/
19+
/spec/fixtures/modules/
20+
/tmp/
21+
/vendor/
22+
/convert_report.txt
23+
/update_report.txt
24+
.DS_Store
25+
.project
26+
.envrc
27+
/inventory.yaml
28+
/appveyor.yml
29+
/.fixtures.yml
30+
/Gemfile
31+
/.gitattributes
32+
/.gitignore
33+
/.gitlab-ci.yml
34+
/.pdkignore
35+
/Rakefile
36+
/rakelib/
37+
/.rspec
38+
/.rubocop.yml
39+
/.travis.yml
40+
/.yardopts
41+
/spec/
42+
/.vscode/

.puppet-lint.rc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--relative

.rspec

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
--format documentation
21
--color
3-
--tty
2+
--format documentation

.rubocop.yml

+126
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
---
2+
require:
3+
- rubocop-rspec
4+
- rubocop-i18n
5+
AllCops:
6+
DisplayCopNames: true
7+
TargetRubyVersion: '2.1'
8+
Include:
9+
- "./**/*.rb"
10+
Exclude:
11+
- bin/*
12+
- ".vendor/**/*"
13+
- "**/Gemfile"
14+
- "**/Rakefile"
15+
- pkg/**/*
16+
- spec/fixtures/**/*
17+
- vendor/**/*
18+
- "**/Puppetfile"
19+
- "**/Vagrantfile"
20+
- "**/Guardfile"
21+
Metrics/LineLength:
22+
Description: People have wide screens, use them.
23+
Max: 200
24+
GetText:
25+
Enabled: false
26+
GetText/DecorateString:
27+
Description: We don't want to decorate test output.
28+
Exclude:
29+
- spec/*
30+
RSpec/BeforeAfterAll:
31+
Description: Beware of using after(:all) as it may cause state to leak between tests.
32+
A necessary evil in acceptance testing.
33+
Exclude:
34+
- spec/acceptance/**/*.rb
35+
RSpec/HookArgument:
36+
Description: Prefer explicit :each argument, matching existing module's style
37+
EnforcedStyle: each
38+
Style/BlockDelimiters:
39+
Description: Prefer braces for chaining. Mostly an aesthetical choice. Better to
40+
be consistent then.
41+
EnforcedStyle: braces_for_chaining
42+
Style/ClassAndModuleChildren:
43+
Description: Compact style reduces the required amount of indentation.
44+
EnforcedStyle: compact
45+
Style/EmptyElse:
46+
Description: Enforce against empty else clauses, but allow `nil` for clarity.
47+
EnforcedStyle: empty
48+
Style/FormatString:
49+
Description: Following the main puppet project's style, prefer the % format format.
50+
EnforcedStyle: percent
51+
Style/FormatStringToken:
52+
Description: Following the main puppet project's style, prefer the simpler template
53+
tokens over annotated ones.
54+
EnforcedStyle: template
55+
Style/Lambda:
56+
Description: Prefer the keyword for easier discoverability.
57+
EnforcedStyle: literal
58+
Style/RegexpLiteral:
59+
Description: Community preference. See https://github.com/voxpupuli/modulesync_config/issues/168
60+
EnforcedStyle: percent_r
61+
Style/TernaryParentheses:
62+
Description: Checks for use of parentheses around ternary conditions. Enforce parentheses
63+
on complex expressions for better readability, but seriously consider breaking
64+
it up.
65+
EnforcedStyle: require_parentheses_when_complex
66+
Style/TrailingCommaInArguments:
67+
Description: Prefer always trailing comma on multiline argument lists. This makes
68+
diffs, and re-ordering nicer.
69+
EnforcedStyleForMultiline: comma
70+
Style/TrailingCommaInLiteral:
71+
Description: Prefer always trailing comma on multiline literals. This makes diffs,
72+
and re-ordering nicer.
73+
EnforcedStyleForMultiline: comma
74+
Style/SymbolArray:
75+
Description: Using percent style obscures symbolic intent of array's contents.
76+
EnforcedStyle: brackets
77+
RSpec/MessageSpies:
78+
EnforcedStyle: receive
79+
Style/Documentation:
80+
Exclude:
81+
- lib/puppet/parser/functions/**/*
82+
- spec/**/*
83+
Style/WordArray:
84+
EnforcedStyle: brackets
85+
Style/CollectionMethods:
86+
Enabled: true
87+
Style/MethodCalledOnDoEndBlock:
88+
Enabled: true
89+
Style/StringMethods:
90+
Enabled: true
91+
Layout/EndOfLine:
92+
Enabled: false
93+
Layout/IndentHeredoc:
94+
Enabled: false
95+
Metrics/AbcSize:
96+
Enabled: false
97+
Metrics/BlockLength:
98+
Enabled: false
99+
Metrics/ClassLength:
100+
Enabled: false
101+
Metrics/CyclomaticComplexity:
102+
Enabled: false
103+
Metrics/MethodLength:
104+
Enabled: false
105+
Metrics/ModuleLength:
106+
Enabled: false
107+
Metrics/ParameterLists:
108+
Enabled: false
109+
Metrics/PerceivedComplexity:
110+
Enabled: false
111+
RSpec/DescribeClass:
112+
Enabled: false
113+
RSpec/ExampleLength:
114+
Enabled: false
115+
RSpec/MessageExpectation:
116+
Enabled: false
117+
RSpec/MultipleExpectations:
118+
Enabled: false
119+
RSpec/NestedGroups:
120+
Enabled: false
121+
Style/AsciiComments:
122+
Enabled: false
123+
Style/IfUnlessModifier:
124+
Enabled: false
125+
Style/SymbolProc:
126+
Enabled: false

.sync.yml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
.travis.yml:
3+
docker_sets:
4+
- set: centos-7
5+
collection: puppet5
6+
- set: centos-7
7+
collection: puppet6
8+
- set: centos-6
9+
collection: puppet5
10+
- set: centos-6
11+
collection: puppet6
12+
user: treydock
13+
secure: "eQ2DMNNi1f7J8B+kzJcb1Udi3fMf21gchyprlO/VTdezdetMiJq/rVIQdTWw4KOLIHE/bG6l/S9SMo1becEppzHPKF89HKyOArAD5G6gIPJxP7Jb6l0+dys8zLWHW1szmrcyt1xpBwcf1w3Ahq2uhwETT8oNpKzPJGgTz5LsQXs="
14+
.gitlab-ci.yml:
15+
delete: true
16+
appveyor.yml:
17+
delete: true
18+
spec/acceptance/nodesets/debian-8.yml:
19+
delete: true
20+
spec/acceptance/nodesets/debian-9.yml:
21+
delete: true
22+
spec/acceptance/nodesets/ubuntu-1404.yml:
23+
delete: true
24+
spec/acceptance/nodesets/ubuntu-1604.yml:
25+
delete: true
26+
spec/acceptance/nodesets/ubuntu-1804.yml:
27+
delete: true

.travis.yml

+74-24
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,89 @@
11
---
22
language: ruby
3-
sudo: false
43
cache: bundler
4+
before_install:
5+
- bundle -v
6+
- rm -f Gemfile.lock
7+
- gem update --system $RUBYGEMS_VERSION
8+
- gem --version
9+
- bundle -v
10+
script:
11+
- 'bundle exec rake $CHECK'
512
bundler_args: --without system_tests
6-
script: bundle exec rake release_checks
13+
rvm:
14+
- 2.5.3
15+
stages:
16+
- static
17+
- spec
18+
- acceptance
19+
-
20+
if: tag =~ ^v\d
21+
name: deploy
722
matrix:
823
fast_finish: true
924
include:
10-
- rvm: 2.4.4
11-
env: PUPPET_GEM_VERSION="~> 5.0" STRICT_VARIABLES="yes"
12-
- rvm: 2.5.1
13-
env: PUPPET_GEM_VERSION="~> 6.0" STRICT_VARIABLES="yes"
14-
- rvm: 2.4.4
15-
sudo: required
16-
services: docker
17-
env: BEAKER_set="centos-6-x64-docker" BEAKER_PUPPET_COLLECTION=puppet5
18-
bundler_args:
25+
-
26+
bundler_args: --with system_tests
27+
dist: trusty
28+
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_set=centos-7 BEAKER_TESTMODE=apply
29+
rvm: 2.5.3
1930
script: bundle exec rake beaker
20-
- rvm: 2.4.4
21-
sudo: required
2231
services: docker
23-
env: BEAKER_set="centos-6-x64-docker" BEAKER_PUPPET_COLLECTION=puppet6
24-
bundler_args:
25-
script: bundle exec rake beaker
26-
- rvm: 2.4.4
32+
stage: acceptance
2733
sudo: required
28-
services: docker
29-
env: BEAKER_set="centos-7-x64-docker" BEAKER_PUPPET_COLLECTION=puppet5
30-
bundler_args:
34+
-
35+
bundler_args: --with system_tests
36+
dist: trusty
37+
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_set=centos-7 BEAKER_TESTMODE=apply
38+
rvm: 2.5.3
3139
script: bundle exec rake beaker
32-
- rvm: 2.4.4
40+
services: docker
41+
stage: acceptance
3342
sudo: required
43+
-
44+
bundler_args: --with system_tests
45+
dist: trusty
46+
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_set=centos-6 BEAKER_TESTMODE=apply
47+
rvm: 2.5.3
48+
script: bundle exec rake beaker
3449
services: docker
35-
env: BEAKER_set="centos-7-x64-docker" BEAKER_PUPPET_COLLECTION=puppet6
36-
bundler_args:
50+
stage: acceptance
51+
sudo: required
52+
-
53+
bundler_args: --with system_tests
54+
dist: trusty
55+
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_set=centos-6 BEAKER_TESTMODE=apply
56+
rvm: 2.5.3
3757
script: bundle exec rake beaker
58+
services: docker
59+
stage: acceptance
60+
sudo: required
61+
-
62+
env: CHECK="check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop syntax lint metadata_lint"
63+
stage: static
64+
-
65+
env: PUPPET_GEM_VERSION="~> 5.0" CHECK=parallel_spec
66+
rvm: 2.4.5
67+
stage: spec
68+
-
69+
env: PUPPET_GEM_VERSION="~> 6.0" CHECK=parallel_spec
70+
rvm: 2.5.3
71+
stage: spec
72+
-
73+
env: DEPLOY_TO_FORGE=yes
74+
stage: deploy
75+
branches:
76+
only:
77+
- master
78+
- /^v\d/
3879
notifications:
39-
email: false
80+
81+
deploy:
82+
provider: puppetforge
83+
user: treydock
84+
password:
85+
secure: "eQ2DMNNi1f7J8B+kzJcb1Udi3fMf21gchyprlO/VTdezdetMiJq/rVIQdTWw4KOLIHE/bG6l/S9SMo1becEppzHPKF89HKyOArAD5G6gIPJxP7Jb6l0+dys8zLWHW1szmrcyt1xpBwcf1w3Ahq2uhwETT8oNpKzPJGgTz5LsQXs="
86+
on:
87+
tags: true
88+
all_branches: true
89+
condition: "$DEPLOY_TO_FORGE = yes"

.yardopts

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--markup markdown

CONTRIBUTING.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Release Process
2+
3+
1. Update metadata.json version, eg: `pdk bundle exec rake module:bump:{major,minor,patch}`
4+
1. Generate REFERENCE.md: `pdk bundle exec rake strings:generate:reference`
5+
1. Update CHANGELOG.md: `pdk bundle exec rake changelog`
6+
1. Commit changes, eg `git commit -a -m "Release $(cat metadata.json | jq -r '.version')"`
7+
1. Tag, eg: `pdk bundle exec rake module:tag`
8+
1. Update GitHub pages: `pdk bundle exec rake strings:gh_pages:update`
9+
1. Push to GitHub: `git push --tags origin master`

0 commit comments

Comments
 (0)