Skip to content

Commit ade1f29

Browse files
committed
Perform pdk convert
1 parent a74f99a commit ade1f29

15 files changed

+570
-15
lines changed

.gitattributes

+5-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1-
*.png filter=lfs diff=lfs merge=lfs -text
1+
*.rb eol=lf
2+
*.erb eol=lf
3+
*.pp eol=lf
4+
*.sh eol=lf
5+
*.epp eol=lf

.gitignore

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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

.gitlab-ci.yml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
stages:
3+
- syntax
4+
- unit
5+
6+
cache:
7+
paths:
8+
- vendor/bundle
9+
10+
before_script:
11+
- bundle -v
12+
- rm Gemfile.lock || true
13+
- gem update --system $RUBYGEMS_VERSION
14+
- gem --version
15+
- bundle -v
16+
- bundle install --without system_tests --path vendor/bundle --jobs $(nproc)
17+
18+
parallel_spec-Ruby 2.1.9-Puppet ~> 4.0:
19+
stage: unit
20+
image: ruby:2.1.9
21+
script:
22+
- bundle exec rake parallel_spec
23+
variables:
24+
PUPPET_GEM_VERSION: '~> 4.0'
25+
RUBYGEMS_VERSION: '2.7.8'
26+
27+
syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop-Ruby 2.4.4-Puppet ~> 5.5:
28+
stage: syntax
29+
image: ruby:2.4.4
30+
script:
31+
- bundle exec rake syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop
32+
variables:
33+
PUPPET_GEM_VERSION: '~> 5.5'
34+
35+
parallel_spec-Ruby 2.4.4-Puppet ~> 5.5:
36+
stage: unit
37+
image: ruby:2.4.4
38+
script:
39+
- bundle exec rake parallel_spec
40+
variables:
41+
PUPPET_GEM_VERSION: '~> 5.5'
42+

.pdkignore

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
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+
/appveyor.yml
26+
/.fixtures.yml
27+
/Gemfile
28+
/.gitattributes
29+
/.gitignore
30+
/.gitlab-ci.yml
31+
/.pdkignore
32+
/Rakefile
33+
/.rspec
34+
/.rubocop.yml
35+
/.travis.yml
36+
/.yardopts
37+
/spec/

.puppet-lint.rc

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

.rspec

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
--color
2+
--format documentation

.rubocop.yml

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

.travis.yml

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
dist: trusty
3+
language: ruby
4+
cache: bundler
5+
before_install:
6+
- bundle -v
7+
- rm -f Gemfile.lock
8+
- gem update --system $RUBYGEMS_VERSION
9+
- gem --version
10+
- bundle -v
11+
script:
12+
- 'bundle exec rake $CHECK'
13+
bundler_args: --without system_tests
14+
rvm:
15+
- 2.5.1
16+
env:
17+
global:
18+
- BEAKER_PUPPET_COLLECTION=puppet6 PUPPET_GEM_VERSION="~> 6.0"
19+
matrix:
20+
fast_finish: true
21+
include:
22+
-
23+
env: CHECK="syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop"
24+
-
25+
env: CHECK=parallel_spec
26+
-
27+
env: PUPPET_GEM_VERSION="~> 5.0" CHECK=parallel_spec
28+
rvm: 2.4.4
29+
branches:
30+
only:
31+
- master
32+
- /^v\d/
33+
notifications:
34+
email: false
35+
deploy:
36+
provider: puppetforge
37+
user: puppet
38+
password:
39+
secure: ""
40+
on:
41+
tags: true
42+
all_branches: true
43+
condition: "$DEPLOY_TO_FORGE = yes"

.yardopts

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

Gemfile

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
source ENV['GEM_SOURCE'] || 'https://rubygems.org'
2+
3+
def location_for(place_or_version, fake_version = nil)
4+
git_url_regex = %r{\A(?<url>(https?|git)[:@][^#]*)(#(?<branch>.*))?}
5+
file_url_regex = %r{\Afile:\/\/(?<path>.*)}
6+
7+
if place_or_version && (git_url = place_or_version.match(git_url_regex))
8+
[fake_version, { git: git_url[:url], branch: git_url[:branch], require: false }].compact
9+
elsif place_or_version && (file_url = place_or_version.match(file_url_regex))
10+
['>= 0', { path: File.expand_path(file_url[:path]), require: false }]
11+
else
12+
[place_or_version, { require: false }]
13+
end
14+
end
15+
16+
ruby_version_segments = Gem::Version.new(RUBY_VERSION.dup).segments
17+
minor_version = ruby_version_segments[0..1].join('.')
18+
19+
group :development do
20+
gem "fast_gettext", '1.1.0', require: false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.1.0')
21+
gem "fast_gettext", require: false if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.1.0')
22+
gem "json_pure", '<= 2.0.1', require: false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.0.0')
23+
gem "json", '= 1.8.1', require: false if Gem::Version.new(RUBY_VERSION.dup) == Gem::Version.new('2.1.9')
24+
gem "json", '= 2.0.4', require: false if Gem::Requirement.create('~> 2.4.2').satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
25+
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))
26+
gem "puppet-module-posix-default-r#{minor_version}", require: false, platforms: [:ruby]
27+
gem "puppet-module-posix-dev-r#{minor_version}", require: false, platforms: [:ruby]
28+
gem "puppet-module-win-default-r#{minor_version}", require: false, platforms: [:mswin, :mingw, :x64_mingw]
29+
gem "puppet-module-win-dev-r#{minor_version}", require: false, platforms: [:mswin, :mingw, :x64_mingw]
30+
end
31+
32+
puppet_version = ENV['PUPPET_GEM_VERSION']
33+
facter_version = ENV['FACTER_GEM_VERSION']
34+
hiera_version = ENV['HIERA_GEM_VERSION']
35+
36+
gems = {}
37+
38+
gems['puppet'] = location_for(puppet_version)
39+
40+
# If facter or hiera versions have been specified via the environment
41+
# variables
42+
43+
gems['facter'] = location_for(facter_version) if facter_version
44+
gems['hiera'] = location_for(hiera_version) if hiera_version
45+
46+
if Gem.win_platform? && puppet_version =~ %r{^(file:///|git://)}
47+
# If we're using a Puppet gem on Windows which handles its own win32-xxx gem
48+
# dependencies (>= 3.5.0), set the maximum versions (see PUP-6445).
49+
gems['win32-dir'] = ['<= 0.4.9', require: false]
50+
gems['win32-eventlog'] = ['<= 0.6.5', require: false]
51+
gems['win32-process'] = ['<= 0.7.5', require: false]
52+
gems['win32-security'] = ['<= 0.2.5', require: false]
53+
gems['win32-service'] = ['0.8.8', require: false]
54+
end
55+
56+
gems.each do |gem_name, gem_params|
57+
gem gem_name, *gem_params
58+
end
59+
60+
# Evaluate Gemfile.local and ~/.gemfile if they exist
61+
extra_gemfiles = [
62+
"#{__FILE__}.local",
63+
File.join(Dir.home, '.gemfile'),
64+
]
65+
66+
extra_gemfiles.each do |gemfile|
67+
if File.file?(gemfile) && File.readable?(gemfile)
68+
eval(File.read(gemfile), binding)
69+
end
70+
end
71+
# vim: syntax=ruby

0 commit comments

Comments
 (0)