Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for ensure_packages #50

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM puppet/pdk:latest

# [Optional] Uncomment this section to install additional packages.
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
# && apt-get -y install --no-install-recommends <your-package-list-here>

38 changes: 38 additions & 0 deletions .devcontainer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# devcontainer


For format details, see https://aka.ms/devcontainer.json.

For config options, see the README at:
https://github.com/microsoft/vscode-dev-containers/tree/v0.140.1/containers/puppet

``` json
{
"name": "Puppet Development Kit (Community)",
"dockerFile": "Dockerfile",

// Set *default* container specific settings.json values on container create.
"settings": {
"terminal.integrated.profiles.linux": {
"bash": {
"path": "bash",
}
}
},

// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"puppet.puppet-vscode",
"rebornix.Ruby"
],

// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "pdk --version",
}
```



17 changes: 17 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "Puppet Development Kit (Community)",
"dockerFile": "Dockerfile",

"settings": {
"terminal.integrated.profiles.linux": {
"bash": {
"path": "bash"
}
}
},

"extensions": [
"puppet.puppet-vscode",
"rebornix.Ruby"
]
}
10 changes: 0 additions & 10 deletions .fixtures-puppetv3.yml

This file was deleted.

8 changes: 4 additions & 4 deletions .fixtures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ fixtures:
ref: 'v1.7.0'
stdlib:
repo: 'https://github.com/puppetlabs/puppetlabs-stdlib.git'
ref: '4.6.0'
ref: '5.0.0'
cron:
repo: 'git://github.com/puppetlabs/puppetlabs-cron_core.git'
repo: 'https://github.com/puppetlabs/puppetlabs-cron_core.git'
ref: '1.0.0'
mount:
repo: 'git://github.com/puppetlabs/puppetlabs-mount_core.git'
repo: 'https://github.com/puppetlabs/puppetlabs-mount_core.git'
ref: '1.0.2'
selinux:
repo: 'git://github.com/puppetlabs/puppetlabs-selinux_core.git'
repo: 'https://github.com/puppetlabs/puppetlabs-selinux_core.git'
ref: '1.0.1'
symlinks:
types: "#{source_dir}"
5 changes: 5 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*.rb eol=lf
*.erb eol=lf
*.pp eol=lf
*.sh eol=lf
*.epp eol=lf
92 changes: 92 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
---
name: CI

on: pull_request

concurrency:
group: ${{ github.head_ref }}
cancel-in-progress: true

jobs:
setup_matrix:
name: Setup Test Matrix
runs-on: ubuntu-20.04
timeout-minutes: 40
outputs:
puppet_unit_test_matrix: ${{ steps.get-outputs.outputs.puppet_unit_test_matrix }}
github_action_test_matrix: ${{ steps.get-outputs.outputs.github_action_test_matrix }}
steps:
- uses: actions/checkout@v3

- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '2.7.3'
bundler-cache: true

- name: Run static validations
run: bundle exec rake validate lint

- name: Run rake rubocop
run: bundle exec rake rubocop

- name: Setup Test Matrix
id: get-outputs
run: bundle exec metadata2gha --use-fqdn --pidfile-workaround false

unit:
needs: setup_matrix
runs-on: ubuntu-20.04
timeout-minutes: 40
strategy:
fail-fast: false
matrix:
include: ${{fromJson(needs.setup_matrix.outputs.puppet_unit_test_matrix)}}
name: Spec Puppet ${{ matrix.puppet }} (Ruby ${{ matrix.ruby }})
steps:
- uses: actions/checkout@v3

- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true

- name: Run tests
run: bundle exec rake parallel_spec

# TODO: active when acceptance tests have been added
# acceptance:
# name: Litmus Acceptance
# runs-on: ubuntu-20.04
# env:
# BOLT_GEM: true
# CI: true
# steps:
# - uses: actions/checkout@v3
# - name: Setup ruby
# uses: ruby/setup-ruby@v1
# with:
# ruby-version: '2.7.3'
# bundler-cache: true
#
# - name: Provision Testing Environments
# run: |
# bundle exec rake 'litmus:provision_list[default]'
# bundle exec rake 'litmus:install_agent'
# bundle exec rake 'litmus:install_module'
# - name: Run Tests
# run: bundle exec rake 'litmus:acceptance:parallel'
#
# - name: Tear Down
# run: bundle exec rake 'litmus:tear_down'

tests:
needs:
- unit
# TODO: active when acceptance tests have been added
# - acceptance
runs-on: ubuntu-20.04
name: Test suite
steps:
- run: echo Test suite completed
58 changes: 26 additions & 32 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,34 +1,28 @@
# Default .gitignore for Ruby
*.gem
*.rbc
.bundle
.config
coverage
InstalledFiles
lib/bundler/man
pkg
rdoc
spec/reports
test/tmp
test/version_tmp
tmp

# YARD artifacts
.git/
.*.sw[op]
.metadata
.yardoc
_yardoc
doc/

# Vim
*.swp

# Eclipse
.project

# OS X
.yardwarns
*.iml
/.bundle/
/.idea/
/.vagrant/
/coverage/
/bin/
/doc/
/Gemfile.local
/Gemfile.lock
/junit/
/log/
/pkg/
/spec/fixtures/manifests/
/spec/fixtures/modules/
/tmp/
/vendor/
/convert_report.txt
/update_report.txt
.DS_Store

# Puppet
coverage/
spec/fixtures/manifests/*
spec/fixtures/modules/*
Gemfile.lock
.project
.envrc
/inventory.yaml
/spec/fixtures/litmus_inventory.yaml
46 changes: 46 additions & 0 deletions .pdkignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
.git/
.*.sw[op]
.metadata
.yardoc
.yardwarns
*.iml
/.bundle/
/.idea/
/.vagrant/
/coverage/
/bin/
/doc/
/Gemfile.local
/Gemfile.lock
/junit/
/log/
/pkg/
/spec/fixtures/manifests/
/spec/fixtures/modules/
/tmp/
/vendor/
/convert_report.txt
/update_report.txt
.DS_Store
.project
.envrc
/inventory.yaml
/spec/fixtures/litmus_inventory.yaml
/appveyor.yml
/.editorconfig
/.fixtures.yml
/Gemfile
/.gitattributes
/.gitignore
/.gitlab-ci.yml
/.pdkignore
/.puppet-lint.rc
/Rakefile
/rakelib/
/.rspec
/.rubocop.yml
/.yardopts
/spec/
/.vscode/
/.sync.yml
/.devcontainer/
3 changes: 3 additions & 0 deletions .puppet-lint.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
--relative
--no-80chars-check
--no-140chars-check
2 changes: 2 additions & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
--color
--format documentation
Loading