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

Commit

Permalink
(SIMP-3262) Update journald to meet SIMP standards (#5)
Browse files Browse the repository at this point in the history
* Major bump, removed default options API
* Moved params to module data
* Updated Puppet dependency for hiera v5 support
* Added missing inifile dependency in metadata, and updated stdlib version
  dependency
* Converted in-module param documentation to be strings compatible
* Added acceptance suite

SIMP-6219 #comment updated module to be consistent with SIMP standards
SIMP-3262 #close
  • Loading branch information
nick-markowski authored and lnemsick-simp committed Mar 8, 2019
1 parent 8781b59 commit a6436ad
Show file tree
Hide file tree
Showing 24 changed files with 814 additions and 167 deletions.
24 changes: 16 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
*.log
*~
.DS_Store
spec/fixtures/*
*.tmp
.librarian
pkg/*

.*.sw?
.yardoc
dist/
pkg/
spec/fixtures/
spec/rp_env/
!/spec/hieradata/default.yaml
!/spec/fixtures/site.pp
.rspec_system
.vagrant/
.bundle/
Gemfile.lock
vendor/
junit/
log/
doc/
229 changes: 229 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,229 @@
# The testing matrix considers ruby/puppet versions supported by SIMP and PE:
#
# https://puppet.com/docs/pe/2019.0/component_versions_in_recent_pe_releases.html
# https://puppet.com/misc/puppet-enterprise-lifecycle
# https://puppet.com/docs/pe/2018.1/overview/getting_support_for_pe.html
# ------------------------------------------------------------------------------
# Release Puppet Ruby EOL
# SIMP 6.1 4.10.6 2.1.9 TBD
# SIMP 6.2 4.10.12 2.1.9 TBD
# SIMP 6.3 5.5.7 2.4.4 TBD***
# PE 2018.1 5.5.8 2.4.4 2020-05 (LTS)***
# PE 2019.0 6.0 2.5.1 2019-08-31^^^
#
# *** = Modules created for SIMP 6.3+ are not required to support Puppet < 5.5
# ^^^ = SIMP doesn't support 6 yet; tests are info-only and allowed to fail
---
stages:
- 'sanity'
- 'validation'
- 'acceptance'
- 'compliance'
- 'deployment'

variables:
PUPPET_VERSION: 'UNDEFINED' # <- Matrixed jobs MUST override this (or fail)
BUNDLER_VERSION: '1.17.1'

# Force dependencies into a path the gitlab-runner user can write to.
# (This avoids some failures on Runners with misconfigured ruby environments.)
GEM_HOME: .vendor/gem_install
BUNDLE_CACHE_PATH: .vendor/bundle
BUNDLE_PATH: .vendor/bundle
BUNDLE_BIN: .vendor/gem_install/bin
BUNDLE_NO_PRUNE: 'true'


# bundler dependencies and caching
#
# - Cache bundler gems between pipelines foreach Ruby version
# - Try to use cached and local resources before downloading dependencies
# --------------------------------------
.setup_bundler_env: &setup_bundler_env
cache:
untracked: true
key: "${CI_PROJECT_NAMESPACE}_ruby-${MATRIX_RUBY_VERSION}_bundler"
paths:
- '.vendor'
before_script:
- 'ruby -e "puts %(\n\n), %q(=)*80, %(\nSIMP-relevant Environment Variables:\n\n#{e=ENV.keys.grep(/^PUPPET|^SIMP|^BEAKER|MATRIX/); pad=e.map{|x| x.size}.max+1; e.map{|v| %( * #{%(#{v}:).ljust(pad)} #{39.chr + ENV[v] + 39.chr}\n)}.join}\n), %q(=)*80, %(\n\n)"'
- 'declare GEM_BUNDLER_VER=(-v "~> ${BUNDLER_VERSION:-1.17.1}")'
- 'declare GEM_INSTALL_CMD=(gem install --no-document)'
- 'declare BUNDLER_INSTALL_CMD=(bundle install --no-binstubs --jobs $(nproc) "${FLAGS[@]}")'
- 'mkdir -p ${GEM_HOME} ${BUNDLER_BIN}'
- 'gem list -ie "${GEM_BUNDLER_VER[@]}" --silent bundler || "${GEM_INSTALL_CMD[@]}" --local "${GEM_BUNDLER_VER[@]}" bundler || "${GEM_INSTALL_CMD[@]}" "${GEM_BUNDLER_VER[@]}" bundler'
- 'rm -rf pkg/ || :'
- 'bundle check || rm -f Gemfile.lock && ("${BUNDLER_INSTALL_CMD[@]}" --local || "${BUNDLER_INSTALL_CMD[@]}" || bundle pristine || "${BUNDLER_INSTALL_CMD[@]}") || { echo "PIPELINE: Bundler could not install everything (see log output above)" && exit 99 ; }'

# To avoid running a prohibitive number of tests every commit,
# don't set this env var in your gitlab instance
.only_with_SIMP_FULL_MATRIX: &only_with_SIMP_FULL_MATRIX
only:
variables:
- $SIMP_FULL_MATRIX == "yes"

# Puppet Versions
#-----------------------------------------------------------------------

.pup_4: &pup_4
image: 'ruby:2.1'
variables:
PUPPET_VERSION: '~> 4.0'
MATRIX_RUBY_VERSION: '2.1'

.pup_4_10: &pup_4_10
image: 'ruby:2.1'
variables:
PUPPET_VERSION: '~> 4.10.4'
MATRIX_RUBY_VERSION: '2.1'

.pup_5: &pup_5
image: 'ruby:2.4'
variables:
PUPPET_VERSION: '~> 5.0'
BEAKER_PUPPET_COLLECTION: 'puppet5'
MATRIX_RUBY_VERSION: '2.4'

.pup_5_5_7: &pup_5_5_7
image: 'ruby:2.4'
variables:
PUPPET_VERSION: '5.5.7'
BEAKER_PUPPET_COLLECTION: 'puppet5'
MATRIX_RUBY_VERSION: '2.4'

.pup_6: &pup_6
allow_failure: true
image: 'ruby:2.5'
variables:
PUPPET_VERSION: '~> 6.0'
BEAKER_PUPPET_COLLECTION: 'puppet6'
MATRIX_RUBY_VERSION: '2.5'


# Testing Environments
#-----------------------------------------------------------------------

.lint_tests: &lint_tests
stage: 'validation'
tags: ['docker']
<<: *setup_bundler_env
script:
- 'bundle exec rake syntax'
- 'bundle exec rake lint'
- 'bundle exec rake metadata_lint'

.unit_tests: &unit_tests
stage: 'validation'
tags: ['docker']
<<: *setup_bundler_env
script:
- 'bundle exec rake spec'

.acceptance_base: &acceptance_base
stage: 'acceptance'
tags: ['beaker']
<<: *setup_bundler_env

.compliance_base: &compliance_base
stage: 'compliance'
tags: ['beaker']
<<: *setup_bundler_env


# Pipeline / testing matrix
#=======================================================================

sanity_checks:
<<: *pup_5
<<: *setup_bundler_env
stage: 'sanity'
tags: ['docker']
script:
- 'if `hash apt-get`; then apt-get update; fi'
- 'if `hash apt-get`; then apt-get install -y rpm; fi'
- 'bundle exec rake check:dot_underscore'
- 'bundle exec rake check:test_file'
- 'bundle exec rake pkg:check_version'
- 'bundle exec rake pkg:compare_latest_tag'
- 'bundle exec rake pkg:create_tag_changelog'
- 'bundle exec puppet module build'

# Linting
#-----------------------------------------------------------------------

pup4-lint:
<<: *pup_4
<<: *lint_tests

pup5-lint:
<<: *pup_5
<<: *lint_tests

pup6-lint:
<<: *pup_6
<<: *lint_tests

# Unit Tests
#-----------------------------------------------------------------------

pup5-unit:
<<: *pup_5
<<: *unit_tests

pup5.5.7-unit:
<<: *pup_5_5_7
<<: *unit_tests

pup4.10-unit:
<<: *pup_4_10
<<: *unit_tests

pup6-unit:
<<: *pup_6
<<: *unit_tests

# Acceptance Tests
# ==============================================================================
pup4.10:
<<: *pup_4_10
<<: *acceptance_base
script:
- 'bundle exec rake beaker:suites'

pup4.10-fips:
<<: *pup_4_10
<<: *acceptance_base
<<: *only_with_SIMP_FULL_MATRIX
script:
- 'BEAKER_fips=yes bundle exec rake beaker:suites'

pup5.5.7:
<<: *pup_5_5_7
<<: *acceptance_base
script:
- 'bundle exec rake beaker:suites'

pup5.5.7-fips:
<<: *pup_5_5_7
<<: *acceptance_base
script:
- 'BEAKER_fips=yes bundle exec rake beaker:suites'

pup5.5.7-oel:
<<: *pup_5_5_7
<<: *acceptance_base
script:
- 'bundle exec rake beaker:suites[default,oel]'

pup5.5.7-oel-fips:
<<: *pup_5_5_7
<<: *acceptance_base
<<: *only_with_SIMP_FULL_MATRIX
script:
- 'BEAKER_fips=yes bundle exec rake beaker:suites[default,oel]'

# pup5.5.7-compliance-fips:
# <<: *pup_5_5_7
# <<: *compliance_tests
# script:
# - 'BEAKER_fips=yes bundle exec rake beaker:suites[compliance]'
4 changes: 4 additions & 0 deletions .puppet-lint.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
--log-format="%{path}:%{line}:%{check}:%{KIND}:%{message}"
--relative
--no-140chars-check
--no-trailing_comma-check
3 changes: 3 additions & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
--format documentation
--color
--fail-fast
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.4.4
130 changes: 117 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,120 @@
# The testing matrix considers ruby/puppet versions supported by SIMP and PE:
#
# https://puppet.com/docs/pe/2018.1/component_versions_in_recent_pe_releases.html
# https://puppet.com/misc/puppet-enterprise-lifecycle
# https://puppet.com/docs/pe/2018.1/overview/getting_support_for_pe.html
# ------------------------------------------------------------------------------
# Release Puppet Ruby EOL
# SIMP 6.2 4.10 2.1.9 TBD
# PE 2016.4 4.10 2.1.9 2018-12-31 (LTS)
# PE 2017.3 5.3 2.4.4 2018-12-31
# SIMP 6.3 5.5 2.4.4 TBD***
# PE 2018.1 5.5 2.4.4 2020-05 (LTS)***
# PE 2019.0 6.0 2.5.1 2019-08-31^^^
#
# *** = Modules created for SIMP 6.3+ are not required to support Puppet < 5.5
# ^^^ = SIMP doesn't support 6 yet; tests are info-only and allowed to fail

---
language: ruby
script: "bundle exec rake validate && bundle exec rake lint && bundle exec rake spec SPEC_OPTS='--format documentation'"
bundler_args: --without development
matrix:
fast_finish: true
include:
- rvm: 2.1.5
env: PUPPET_VERSION="~> 3.0"
- rvm: 2.1.5
env: PUPPET_VERSION="~> 3.0" FUTURE_PARSER="yes"
- rvm: 2.1.6
env: PUPPET_VERSION="~> 4.0" STRICT_VARIABLES="yes"
- rvm: 2.4.4
env: PUPPET_VERSION="~> 5.0" STRICT_VARIABLES="yes"
cache: bundler
sudo: false

stages:
- check
- spec
- name: deploy
if: 'tag IS present'

bundler_args: --without development system_tests --path .vendor

notifications:
email: false

addons:
apt:
packages:
- rpm

before_install:
- rm -f Gemfile.lock

global:
- STRICT_VARIABLES=yes

jobs:
allow_failures:
- name: 'Latest Puppet 6.x (allowed to fail)'

include:
- stage: check
name: 'Syntax, style, and validation checks'
rvm: 2.4.4
env: PUPPET_VERSION="~> 5"
script:
- bundle exec rake check:dot_underscore
- bundle exec rake check:test_file
- bundle exec rake pkg:check_version
- bundle exec rake metadata_lint
- bundle exec rake pkg:compare_latest_tag
- bundle exec rake pkg:create_tag_changelog
- bundle exec rake lint
- bundle exec puppet module build

- stage: spec
name: 'Puppet 4.10 (SIMP 6.2, PE 2016.4)'
rvm: 2.1.9
env: PUPPET_VERSION="~> 4.10.0"
script:
- bundle exec rake spec

- stage: spec
name: 'Puppet 5.3 (PE 2017.3)'
rvm: 2.4.4
env: PUPPET_VERSION="~> 5.3.0"
script:
- bundle exec rake spec

- stage: spec
rvm: 2.4.4
name: 'Puppet 5.5 (SIMP 6.3, PE 2018.1)'
env: PUPPET_VERSION="~> 5.5.0"
script:
- bundle exec rake spec

- stage: spec
name: 'Latest Puppet 5.x'
rvm: 2.4.4
env: PUPPET_VERSION="~> 5.0"
script:
- bundle exec rake spec

- stage: spec
name: 'Latest Puppet 6.x (allowed to fail)'
rvm: 2.5.1
env: PUPPET_VERSION="~> 6.0"
script:
- bundle exec rake spec

- stage: deploy
rvm: 2.4.4
script:
- true
before_deploy:
- "export PUPMOD_METADATA_VERSION=`ruby -r json -e \"puts JSON.parse(File.read('metadata.json')).fetch('version')\"`"
- '[[ $TRAVIS_TAG =~ ^simp-${PUPMOD_METADATA_VERSION}$|^${PUPMOD_METADATA_VERSION}$ ]]'
deploy:
- provider: releases
api_key:
secure: "a7NDwZiQUJtofLmiTsVciMKig5aX3YFwLcv0QjW68UXSmCXdPHYcaV/AAVTPbG8+vpRTLxnN2eUNoS4aikUlbbokC814H8H/Cv7L1RxRS4HSrUZFeQX6Pt+4EYe37eenbife5QVufiEO/J7sDwBdMygbSTMIOY3akScA4OEbrEkPmVb1fXL0+e4h6jiinYMWy8AmrW3or4F2KOH3O14Kf0o16pluVZsix5IK7MY8D7LzqIRmfMSlm7ykeGFSuP2qLM+l99mGpztwWQXcjWPNJSYoBAV+yz8a7dzReQqqzQnKMvOiV4u40spstIhZn1u/fMe6fHGtVeaW97xiLeRrSsl4APcAIt/DQt+Njyf5U3nbQ7yc7mqZzYbiUxzRP/niTG+PX+V5P0stHn9V/kSIZso4UVKPPdsbAuuulOeSDfPxXCZOMzkIEtXtNF/z5J6WXk1OQdNAFw2uyeVR02m59LJh817N8vB8BuwDnaAHeTQgmAs9IwX2Ru7XPDkNgEnnm49x+vjzdjp/Vm6gqQwV7pT2rXI4a6VrwFLfS+UrL0cKmzR7+nHRebEnI1MZmo5MXVt3yiae5DyUBp1lNwM+SjL3KsUnUO/HYY34rUoof/PEvZJuKa54Ik1JnE9VWDIgEWx/pOpa3ajYJlhA02BGx64VPkjjI+o4an00G08C7OQ="
skip_cleanup: true
on:
tags: true
condition: '($SKIP_FORGE_PUBLISH != true)'
- provider: puppetforge
user: simp
password:
secure: "EPe9z4DrHZzOALuRhB/u8Cxby3Dk744Qk77sW+CC+ac9JalaYbERkgBeyZqZjrgGZSoIWjHzKS8jcn/ssiEKiVXRU0XZhek77is70t5EKSxKy67fcGRcL4fqJn1fU/5ackmyCp/7xHmgRMiaGqeUq1zHCjrQPbY78QSGW1dWeSbLuvtOhjVp5tfR7OeODLGnTmvrAfzkphQfroPAEUAw0t3CDBSNELrKMGDDQCUMJXSpSiK+rvKr/qgcihxYDRp2zW5z0xbBnGNLfkmvhan8yT3vCISEFWICN8mCuSIvyvpWfP5E2E1gzQUx3ZBgV20GIqoZX87RJpVAfruZYHn15yBxnPwxnKwkELPKchCiih4IHa1E0YZv2xtxyJvZogUvIkQgJaaDZ7sk93hXAWk0AaGqeBbQML32VaGhYXROpRZecXFx+3kFnFhLxJVYVakjYQhll6r0a8BOSem7Jcy0SsNqGllVMmx7LqXX071ooA2wb0GVOO7qrvKR77He5Wt0lf/S3mg+XPBnnW4p4OyLw3fWERMFgr/pClla/r0NdM3WrMwGKcMbtTgC4Jg/WPHrsCcNgqGs+KaGUkmQxIl4QOPzHCWlDtfoConSFR1t/heNwVc8hKP9Oe+1Y+euSIqbLWwIJ37egE6tO9dIF28V2hNlaHyWJIEXeTQV8lDurTY="
on:
tags: true
condition: '($SKIP_FORGE_PUBLISH != true)'
Loading

0 comments on commit a6436ad

Please sign in to comment.