Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

Commit

Permalink
(GH-12) Add example spec puppet configuration
Browse files Browse the repository at this point in the history
This commit mocks up a configuration file for pupetlabs_spec_helper. 
The accompanying Dockerfile demonstrates how this would be translated into a docker image.
  • Loading branch information
da-ar committed Nov 17, 2021
1 parent 076cd30 commit 4759bb5
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 0 deletions.
26 changes: 26 additions & 0 deletions examples/tools/spec_puppet/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# based upon the work in https://github.com/da-ar/pcv-test/
# this file is a mock up of what a generated file based on the prm-config.yml
# would have to contain in order to work.

# build with:
# docker build -t pdk:puppet-7.11.0-puppet_spec -f examples/tools/spec_puppet/Dockerfile .

# run with:
# needs_write_access: true
# docker run -v ${PWD}:/module -w /module pdk:puppet-7.11.0-puppet_spec

# gem - gems need ruby - so get puppet...
FROM puppet/puppet-agent:7.11.0
# requires_git: true
RUN apt update
RUN apt install git -y
# name: [puppetlabs_spec_helper, rspec-puppet-facts]
RUN /opt/puppetlabs/puppet/bin/gem install puppetlabs_spec_helper --no-document
RUN /opt/puppetlabs/puppet/bin/gem install rspec-puppet-facts --no-document
COPY examples/tools/spec_puppet/content/Rakefile /tmp/Rakefile
VOLUME [ "/module" ]

# executable: rake
ENTRYPOINT [ "/opt/puppetlabs/puppet/bin/rake" ,"-f", "/tmp/Rakefile"]
# default_args: [spec]
CMD [ "spec" ]
1 change: 1 addition & 0 deletions examples/tools/spec_puppet/content/Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
require 'puppetlabs_spec_helper/rake_tasks'
21 changes: 21 additions & 0 deletions examples/tools/spec_puppet/prm-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
plugin:
author: puppetlabs
id: spec_puppet
display: Spec Puppet
version: 0.1.0
upstream_project_url: https://github.com/puppetlabs/puppetlabs_spec_helper

gem:
build_tools: false
name: [puppetlabs_spec_helper, rspec-puppet-facts]
executable: rake

common:
requires_git: true # suggested new
can_validate: true
needs_write_access: true
default_args: [spec]
help_arg: '--help'
success_exit_code: 0
interleave_stdout_err: false

0 comments on commit 4759bb5

Please sign in to comment.