Skip to content

Commit

Permalink
Merge pull request #5 from betadots/test_catalog_diff
Browse files Browse the repository at this point in the history
update
  • Loading branch information
tuxmea committed Jun 26, 2023
2 parents 9f095c5 + 5feba70 commit dad1a42
Show file tree
Hide file tree
Showing 5 changed files with 114 additions and 103 deletions.
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.2.2
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ RUN apt-get install -y apt-utils \
zlib1g-dev \
yamllint \
python3-yaml \
&& wget https://apt.puppet.com/puppet-tools-release-bullseye.deb \
&& dpkg -i puppet-tools-release-bullseye.deb \
&& wget https://apt.puppet.com/puppet-release-bullseye.deb \
&& dpkg -i puppet-release-bullseye.deb \
&& apt-get update -qq \
&& apt-get install -y --no-install-recommends pdk \
&& apt-get install -y --no-install-recommends pdk puppetdb-termini\
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /opt/puppetlabs/pdk/private/puppet/ruby/2.5.0/gems/httpclient-2.8.3/sample/ssl/* \
Expand All @@ -55,6 +55,7 @@ RUN apt-get install -y apt-utils \

RUN ln -s /bin/mkdir /usr/bin/mkdir
RUN ln -s /usr/bin/python3 /usr/local/bin/python
RUN /opt/puppetlabs/puppet/bin/puppet module install puppet-catalog_diff

# Run tests on a module created with PDK 1.18.1 using the current PDK to pull in
# any other dependencies and then delete the 1.18.1 test module.
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ gem 'ffi', '~> 1.15'
gem 'hiera-eyaml', '~> 3.3'
gem 'json', '~> 2.6'
gem 'nokogiri', '~> 1.14'
gem 'onceover-codequality', '~> 0.9'
gem 'onceover-codequality', '~> 0.10'
gem 'onceover-lookup', '~> 0.1', '>= 0.1.1'
gem 'onceover-octocatalog-diff', '~> 0.1', '>= 0.1.8'
gem 'onceover', '~> 3.20'
Expand Down
197 changes: 98 additions & 99 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ GEM
builder (>= 2.1.2)
rexml (~> 3.0)
hashdiff (1.0.1)
hiera (3.12.0)
hiera-eyaml (3.3.0)
highline
optimist
Expand Down Expand Up @@ -178,10 +177,10 @@ GEM
rspec_junit_formatter (>= 0.2.0)
terminal-table (>= 1.8.0)
versionomy (>= 0.5.0)
onceover-codequality (0.9.0)
onceover-codequality (0.10.0)
onceover (~> 3)
puppet-lint (~> 3)
puppet-strings (~> 3)
puppet-lint (~> 4)
puppet-strings (~> 4)
puppet-syntax (~> 3)
onceover-lookup (0.1.1)
onceover (~> 3)
Expand All @@ -192,79 +191,78 @@ GEM
parallel (1.22.1)
parallel_tests (4.2.0)
parallel
parser (3.2.1.1)
parser (3.2.2.3)
ast (~> 2.4.1)
racc
pathspec (1.1.3)
prime (0.1.2)
forwardable
singleton
public_suffix (5.0.1)
puppet (7.23.0)
puppet (8.0.1)
concurrent-ruby (~> 1.0, < 1.2.0)
deep_merge (~> 1.0)
facter (> 2.0.1, < 5)
fast_gettext (>= 1.1, < 3)
hiera (>= 3.2.1, < 4)
facter (>= 4.3.0, < 5)
fast_gettext (>= 2.1, < 3)
locale (~> 2.1)
multi_json (~> 1.10)
multi_json (~> 1.13)
puppet-resource_api (~> 1.5)
scanf (~> 1.0)
semantic_puppet (~> 1.0)
puppet (7.23.0-universal-darwin)
puppet (8.0.1-universal-darwin)
CFPropertyList (~> 2.2)
concurrent-ruby (~> 1.0, < 1.2.0)
deep_merge (~> 1.0)
facter (> 2.0.1, < 5)
fast_gettext (>= 1.1, < 3)
hiera (>= 3.2.1, < 4)
facter (>= 4.3.0, < 5)
fast_gettext (>= 2.1, < 3)
locale (~> 2.1)
multi_json (~> 1.10)
multi_json (~> 1.13)
puppet-resource_api (~> 1.5)
scanf (~> 1.0)
semantic_puppet (~> 1.0)
puppet-lint (3.3.0)
puppet-lint-absolute_classname-check (3.1.0)
puppet-lint (>= 1.0, < 4)
puppet-lint-anchor-check (1.1.0)
puppet-lint (>= 1.1, < 4)
puppet-lint-file_ensure-check (1.1.0)
puppet-lint (>= 1.0, < 4)
puppet-lint-leading_zero-check (1.1.0)
puppet-lint (>= 1.0, < 4.0)
puppet-lint-lookup_in_parameter-check (1.1.0)
puppet-lint (>= 2.0, < 4)
puppet-lint-manifest_whitespace-check (0.2.9)
puppet-lint (>= 1.0, < 4)
puppet-lint-optional_default-check (1.1.0)
puppet-lint (>= 2.1, < 4)
puppet-lint-param-docs (1.7.6)
puppet-lint (>= 1.1, < 4.0)
puppet-lint-param-types (1.0.0)
puppet-lint (>= 1.1, < 4)
puppet-lint-params_empty_string-check (1.1.0)
puppet-lint (>= 2.5, < 4)
puppet-lint-resource_reference_syntax (1.2.0)
puppet-lint (>= 1.0, < 4)
puppet-lint-strict_indent-check (2.1.0)
puppet-lint (>= 1.0, < 4)
puppet-lint-topscope-variable-check (1.2.0)
puppet-lint (>= 2.0, < 4)
puppet-lint-trailing_comma-check (1.0.0)
puppet-lint (>= 1.0, < 4)
puppet-lint-unquoted_string-check (2.2.0)
puppet-lint (>= 2.1, < 4)
puppet-lint-variable_contains_upcase (1.3.0)
puppet-lint (>= 1.0, < 4)
puppet-lint-version_comparison-check (1.1.0)
puppet-lint (>= 1.0, < 4)
puppet-lint (4.0.0)
puppet-lint-absolute_classname-check (4.0.0)
puppet-lint (>= 3.0, < 5)
puppet-lint-anchor-check (2.0.0)
puppet-lint (>= 3, < 5)
puppet-lint-file_ensure-check (2.0.0)
puppet-lint (>= 3, < 5)
puppet-lint-leading_zero-check (2.0.0)
puppet-lint (>= 3, < 5)
puppet-lint-lookup_in_parameter-check (2.0.0)
puppet-lint (>= 3, < 5)
puppet-lint-manifest_whitespace-check (0.3.0)
puppet-lint (>= 1.0, < 5)
puppet-lint-optional_default-check (2.0.0)
puppet-lint (>= 3, < 5)
puppet-lint-param-docs (2.0.0)
puppet-lint (>= 3, < 5)
puppet-lint-param-types (2.0.0)
puppet-lint (>= 3, < 5)
puppet-lint-params_empty_string-check (2.0.0)
puppet-lint (>= 3, < 5)
puppet-lint-resource_reference_syntax (2.0.0)
puppet-lint (>= 3, < 5)
puppet-lint-strict_indent-check (3.0.0)
puppet-lint (>= 3, < 5)
puppet-lint-topscope-variable-check (2.0.0)
puppet-lint (>= 3, < 5)
puppet-lint-trailing_comma-check (2.0.0)
puppet-lint (>= 3, < 5)
puppet-lint-unquoted_string-check (3.0.0)
puppet-lint (>= 3, < 5)
puppet-lint-variable_contains_upcase (2.0.0)
puppet-lint (>= 3, < 5)
puppet-lint-version_comparison-check (2.0.0)
puppet-lint (>= 3, < 5)
puppet-modulebuilder (0.3.0)
minitar (~> 0.9)
pathspec (>= 0.2.1, < 2.0.0)
puppet-resource_api (1.8.14)
hocon (>= 1.0)
puppet-strings (3.0.1)
rgen (~> 0.9.0)
yard (~> 0.9.5)
puppet-strings (4.0.0)
rgen (~> 0.9)
yard (~> 0.9)
puppet-syntax (3.3.0)
puppet (>= 5)
rake
Expand All @@ -273,13 +271,13 @@ GEM
faraday_middleware (~> 1.0)
minitar
semantic_puppet (~> 1.0)
puppetlabs_spec_helper (5.0.3)
puppetlabs_spec_helper (6.0.1)
mocha (~> 1.0)
pathspec (>= 0.2, < 2.0.0)
puppet-lint (>= 2.5.2, < 4.0.0)
puppet-lint (>= 3.0.0)
puppet-syntax (~> 3.0)
rspec-github (~> 2.0)
rspec-puppet (~> 2.0)
rspec-puppet (>= 2.0)
r10k (3.15.4)
colored2 (= 3.1.2)
cri (>= 2.15.10)
Expand All @@ -303,7 +301,7 @@ GEM
rainbow (3.1.1)
rake (13.0.6)
rchardet (1.8.0)
regexp_parser (2.7.0)
regexp_parser (2.8.1)
rexml (3.2.5)
rgen (0.9.1)
rspec (3.12.0)
Expand All @@ -323,7 +321,7 @@ GEM
rspec-mocks (3.12.4)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.12.0)
rspec-puppet (2.12.0)
rspec-puppet (3.0.0)
rspec
rspec-puppet-facts (2.0.5)
facter
Expand All @@ -339,28 +337,31 @@ GEM
rspec_junit_formatter (0.6.0)
rspec-core (>= 2, < 4, != 2.12.0)
rsync (1.0.9)
rubocop (1.48.1)
rubocop (1.52.1)
json (~> 2.3)
parallel (~> 1.10)
parser (>= 3.2.0.0)
parser (>= 3.2.2.3)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.26.0, < 2.0)
rubocop-ast (>= 1.28.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.28.0)
rubocop-ast (1.29.0)
parser (>= 3.2.1.0)
rubocop-capybara (2.17.1)
rubocop-capybara (2.18.0)
rubocop (~> 1.41)
rubocop-performance (1.16.0)
rubocop-factory_bot (2.23.1)
rubocop (~> 1.33)
rubocop-performance (1.18.0)
rubocop (>= 1.7.0, < 2.0)
rubocop-ast (>= 0.4.0)
rubocop-rake (0.6.0)
rubocop (~> 1.0)
rubocop-rspec (2.19.0)
rubocop-rspec (2.22.0)
rubocop (~> 1.33)
rubocop-capybara (~> 2.17)
rubocop-factory_bot (~> 2.22)
ruby-ll (2.1.2)
ansi
ast
Expand Down Expand Up @@ -413,26 +414,25 @@ GEM
rspec-github (~> 2.0)
serverspec
winrm
voxpupuli-puppet-lint-plugins (4.0.0)
puppet-lint (~> 3.1)
puppet-lint-absolute_classname-check (~> 3.1)
puppet-lint-anchor-check (~> 1.1)
puppet-lint-file_ensure-check (~> 1.1)
puppet-lint-leading_zero-check (~> 1.0)
puppet-lint-lookup_in_parameter-check (~> 1.0)
puppet-lint-manifest_whitespace-check (~> 0.2.7, < 1.0.0)
puppet-lint-optional_default-check (~> 1.1)
puppet-lint-param-docs (>= 1.7.6, < 2.0.0)
puppet-lint-param-types (~> 1.0)
puppet-lint-params_empty_string-check (~> 1.0)
puppet-lint-resource_reference_syntax (~> 1.1)
puppet-lint-strict_indent-check (~> 2.1)
puppet-lint-topscope-variable-check (~> 1.1)
puppet-lint-trailing_comma-check (~> 1.0)
puppet-lint-unquoted_string-check (~> 2.2)
puppet-lint-variable_contains_upcase (~> 1.2)
puppet-lint-version_comparison-check (~> 1.1)
webrick (1.7.0)
voxpupuli-puppet-lint-plugins (5.0.0)
puppet-lint (~> 4.0)
puppet-lint-absolute_classname-check (~> 4.0)
puppet-lint-anchor-check (~> 2.0)
puppet-lint-file_ensure-check (~> 2.0)
puppet-lint-leading_zero-check (~> 2.0)
puppet-lint-lookup_in_parameter-check (~> 2.0)
puppet-lint-manifest_whitespace-check (~> 0.3, < 1.0.0)
puppet-lint-optional_default-check (~> 2.0)
puppet-lint-param-docs (~> 2.0)
puppet-lint-param-types (~> 2.0)
puppet-lint-params_empty_string-check (~> 2.0)
puppet-lint-resource_reference_syntax (~> 2.0)
puppet-lint-strict_indent-check (~> 3.0)
puppet-lint-topscope-variable-check (~> 2.0)
puppet-lint-trailing_comma-check (~> 2.0)
puppet-lint-unquoted_string-check (~> 3.0)
puppet-lint-variable_contains_upcase (~> 2.0)
puppet-lint-version_comparison-check (~> 2.0)
winrm (2.3.6)
builder (>= 2.1.2)
erubi (~> 1.8)
Expand All @@ -444,8 +444,7 @@ GEM
rubyntlm (~> 0.6.0, >= 0.6.3)
yamllint (0.0.9)
trollop (~> 2)
yard (0.9.28)
webrick (~> 1.7.0)
yard (0.9.34)

PLATFORMS
x86_64-darwin-22
Expand All @@ -455,32 +454,32 @@ DEPENDENCIES
beaker (~> 5.1)
ffi (~> 1.15)
hiera-eyaml (~> 3.3)
json (~> 2.3)
json (~> 2.6)
minitest (~> 5.18)
nokogiri (~> 1.14)
onceover (~> 3.20)
onceover-codequality (~> 0.9)
onceover-codequality (~> 0.10)
onceover-lookup (~> 0.1, >= 0.1.1)
onceover-octocatalog-diff (~> 0.1, >= 0.1.8)
parallel (~> 1.22, >= 1.22.1)
puppet (~> 7.23)
puppet-lint (~> 3.3)
puppet-strings (~> 3.0, >= 3.0.1)
puppet (~> 8.0)
puppet-lint (~> 4.0)
puppet-strings (~> 4.0)
puppet-syntax (~> 3.3)
puppetlabs_spec_helper (~> 5.0)
puppetlabs_spec_helper (~> 6.0)
r10k (~> 3.15)
ra10ke (~> 2.0)
rspec-puppet (~> 2.12)
rspec-puppet (~> 3.0)
rspec-puppet-facts (~> 2.0, >= 2.0.5)
rspec-puppet-utils (~> 3.4)
rubocop (~> 1.48)
rubocop-performance (~> 1.16)
rubocop (~> 1.50)
rubocop-performance (~> 1.17)
rubocop-rake (~> 0.6)
rubocop-rspec (~> 2.19)
rubocop-rspec (~> 2.20)
unf_ext (~> 0.0.8)
voxpupuli-acceptance (~> 1.2)
voxpupuli-puppet-lint-plugins (~> 4.0)
voxpupuli-puppet-lint-plugins (~> 5.0)
yamllint (~> 0.0.9)

BUNDLED WITH
2.4.7
2.4.14
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ You can use this container by running `docker run --rm -v $(pwd):/repo ghcr.io/b
- run a single rake task like so: `docker run --rm -v $(pwd):/repo ghcr.io/betadots/puppet-dev-tools:latest rake -f /Rakefile lint`
- run multiple rake tasks sequentially like so: `docker run --rm -v $(pwd):/repo ghcr.io/betadots/puppet-dev-tools:latest rake -f /Rakefile lint syntax yamllint`

4. Puppet - `puppet`
- remove the GEM_HOME environment variable `unset GEM_HOME`
- now you can use the puppet-agent installed puppet: `/opt/puppetlabs/puppet/bin/puppet --version`

### A note on Onceover usage

If your control repository contains a Gemfile you will likely want to modify the commands listed above to something like this:
Expand All @@ -31,6 +35,12 @@ docker run --rm -v $(pwd):/repo ghcr.io/betadots/puppet-dev-tools:latest \
/bin/bash -c "bundle install && bundle exec onceover run spec --force --trace --parallel"
```

### A note on using puppet catalog-diff

The voxpupuli catalog-diff module and its dependencies (puppetdb-termini) are part of this container.

To allow running `puppet catalog diff` one must unset the GEM_HOME variable `unset GEM_HOME` and can then run puppet using the full path: `unset GEM_HOME && /opt/puppetlabs/puppet/bin/puppet --version`

<!-- Everything below the Rake Tasks header will be overwritten by build.sh -->

### Rake Tasks
Expand Down

0 comments on commit dad1a42

Please sign in to comment.