83 changes: 83 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
version: 2.1

executors:
rubypuppet:
parameters:
ruby_version:
type: string
puppet_gem_version:
type: string
docker:
- image: circleci/ruby:<< parameters.ruby_version >>
environment:
PUPPET_GEM_VERSION: << parameters.puppet_gem_version >>

commands:
runspecs:
description: "A command for running rake spec"
parameters:
spec_command:
type: string
#default: "parallel_spec"
steps:
- checkout
- run: bundle -v
- run: rm -f Gemfile.lock
- run: gem update --system $RUBYGEMS_VERSION
- run: gem --version
- run: bundle -v
- run: ruby -v | tee ruby_version.txt
- restore_cache:
keys:
- cache-{{ .Environment.CIRCLE_PROJECT_REPONAME }}-{{ checksum "ruby_version.txt" }}-{{ checksum "Gemfile" }}-{{ .Environment.CIRCLE_PR_NUMBER }}
- cache-{{ .Environment.CIRCLE_PROJECT_REPONAME }}-{{ checksum "ruby_version.txt" }}-{{ checksum "Gemfile" }}-
- cache-{{ .Environment.CIRCLE_PROJECT_REPONAME }}-{{ checksum "ruby_version.txt" }}-
- cache-{{ .Environment.CIRCLE_PROJECT_REPONAME }}-
- run: bundle install --jobs $(nproc) --path vendor/bundle
- run: bundle clean --force
- save_cache:
key: cache-{{ .Environment.CIRCLE_PROJECT_REPONAME }}-{{ checksum "ruby_version.txt" }}-{{ checksum "Gemfile" }}-{{ .Environment.CIRCLE_PR_NUMBER }}
paths:
- vendor/bundle
- run: bundle exec rake << parameters.spec_command >>

jobs:
run_specs_on_ruby_puppet_combo:
parameters:
ruby_version:
type: string
puppet_gem_version:
type: string
spec_command:
type: string
executor:
name: rubypuppet
ruby_version: << parameters.ruby_version >>
puppet_gem_version: << parameters.puppet_gem_version >>
steps:
- runspecs:
spec_command: << parameters.spec_command >>

workflows:
version: 2
PDK:
jobs:
- run_specs_on_ruby_puppet_combo:
name: lint
ruby_version: "2.5.3"
puppet_gem_version: "~> 6.0"
spec_command: "check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop syntax lint metadata_lint"
- run_specs_on_ruby_puppet_combo:
name: puppet6specs
ruby_version: "2.5.3"
puppet_gem_version: "~> 6.0"
spec_command: "parallel_spec"
requires:
- lint
- run_specs_on_ruby_puppet_combo:
name: puppet5specs
ruby_version: "2.4.5"
puppet_gem_version: "~> 5.0"
spec_command: "parallel_spec"
requires:
- lint
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@
/convert_report.txt
/update_report.txt
.DS_Store
.project
.envrc
/inventory.yaml
5 changes: 5 additions & 0 deletions .pdkignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
/convert_report.txt
/update_report.txt
.DS_Store
.project
.envrc
/inventory.yaml
/appveyor.yml
/.fixtures.yml
/Gemfile
Expand All @@ -30,8 +33,10 @@
/.gitlab-ci.yml
/.pdkignore
/Rakefile
/rakelib/
/.rspec
/.rubocop.yml
/.travis.yml
/.yardopts
/spec/
/.vscode/
8 changes: 6 additions & 2 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
---
require: rubocop-rspec
require:
- rubocop-rspec
- rubocop-i18n
AllCops:
DisplayCopNames: true
TargetRubyVersion: '2.1'
Expand All @@ -19,10 +21,12 @@ AllCops:
Metrics/LineLength:
Description: People have wide screens, use them.
Max: 200
GetText:
Enabled: false
GetText/DecorateString:
Description: We don't want to decorate test output.
Exclude:
- spec/*
- spec/**/*
RSpec/BeforeAfterAll:
Description: Beware of using after(:all) as it may cause state to leak between tests.
A necessary evil in acceptance testing.
Expand Down
5 changes: 5 additions & 0 deletions .sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,8 @@ Rakefile:
extra_disabled_lint_checks:
- '2sp_soft_tabs'
- 'arrow_alignment'

.travis.yml:
includes:
- env: PUPPET_GEM_VERSION="= 4.6.1" CHECK=parallel_spec
rvm: 2.1.9
43 changes: 21 additions & 22 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
---
dist: trusty
dist: xenial
language: ruby
cache: bundler
before_install:
- if [ $BUNDLER_VERSION ]; then
gem install -v $BUNDLER_VERSION bundler --no-rdoc --no-ri;
fi
- bundle -v
- rm -f Gemfile.lock
- gem update --system $RUBYGEMS_VERSION
Expand All @@ -15,35 +12,37 @@ script:
- 'bundle exec rake $CHECK'
bundler_args: --without system_tests
rvm:
- 2.5.1
env:
global:
- BEAKER_PUPPET_COLLECTION=puppet6 PUPPET_GEM_VERSION="~> 6.0"
- 2.5.3
stages:
- static
- spec
- acceptance
-
if: tag =~ ^v\d
name: deploy
matrix:
fast_finish: true
include:
-
env: CHECK="syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop"
-
env: CHECK=parallel_spec
env: CHECK="check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop syntax lint metadata_lint"
stage: static
-
env: PUPPET_GEM_VERSION="~> 5.0" CHECK=parallel_spec
rvm: 2.4.4
rvm: 2.4.5
stage: spec
-
env: PUPPET_GEM_VERSION="~> 6.0" CHECK=parallel_spec
rvm: 2.5.3
stage: spec
-
env: DEPLOY_TO_FORGE=yes
stage: deploy
-
env: PUPPET_GEM_VERSION="~> 4.0" CHECK=parallel_spec RUBYGEMS_VERSION=2.7.8 BUNDLER_VERSION=1.17.3
env: PUPPET_GEM_VERSION="= 4.6.1" CHECK=parallel_spec
rvm: 2.1.9
branches:
only:
- master
- /^v\d/
notifications:
email: false
deploy:
provider: puppetforge
user: puppet
password:
secure: ""
on:
tags: true
all_branches: true
condition: "$DEPLOY_TO_FORGE = yes"
6 changes: 6 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"recommendations": [
"jpogran.puppet-vscode",
"rebornix.Ruby"
]
}
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## Major Release 1.0.0

- Move from the npwalker namespace to the puppetlabs namespace.
- Remove support for unsupported versions of PE.

## Minor Release 0.15.0

- Make pg_repack the default way to perform maintenance [#25](https://github.com/npwalker/pe_databases/pull/25)
Expand Down
7 changes: 7 additions & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# This will cause the code owners of this repo to be assigned review of any
# opened PRs against the branches containing this file.
# See https://help.github.com/en/articles/about-code-owners for info on how to
# take ownership of parts of the code base that should be reviewed by another
# team.

* @puppetlabs/support
21 changes: 11 additions & 10 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,17 @@ ruby_version_segments = Gem::Version.new(RUBY_VERSION.dup).segments
minor_version = ruby_version_segments[0..1].join('.')

group :development do
gem "fast_gettext", '1.1.0', require: false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.1.0')
gem "fast_gettext", require: false if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.1.0')
gem "json_pure", '<= 2.0.1', require: false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.0.0')
gem "json", '= 1.8.1', require: false if Gem::Version.new(RUBY_VERSION.dup) == Gem::Version.new('2.1.9')
gem "json", '= 2.0.4', require: false if Gem::Requirement.create('~> 2.4.2').satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
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))
gem "puppet-module-posix-default-r#{minor_version}", require: false, platforms: [:ruby]
gem "puppet-module-posix-dev-r#{minor_version}", require: false, platforms: [:ruby]
gem "puppet-module-win-default-r#{minor_version}", require: false, platforms: [:mswin, :mingw, :x64_mingw]
gem "puppet-module-win-dev-r#{minor_version}", require: false, platforms: [:mswin, :mingw, :x64_mingw]
gem "fast_gettext", '1.1.0', require: false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.1.0')
gem "fast_gettext", require: false if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.1.0')
gem "json_pure", '<= 2.0.1', require: false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.0.0')
gem "json", '= 1.8.1', require: false if Gem::Version.new(RUBY_VERSION.dup) == Gem::Version.new('2.1.9')
gem "json", '= 2.0.4', require: false if Gem::Requirement.create('~> 2.4.2').satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
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))
gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw]
gem "puppet-module-posix-default-r#{minor_version}", '~> 0.3', require: false, platforms: [:ruby]
gem "puppet-module-posix-dev-r#{minor_version}", '~> 0.3', require: false, platforms: [:ruby]
gem "puppet-module-win-default-r#{minor_version}", '~> 0.3', require: false, platforms: [:mswin, :mingw, :x64_mingw]
gem "puppet-module-win-dev-r#{minor_version}", '~> 0.3', require: false, platforms: [:mswin, :mingw, :x64_mingw]
end

puppet_version = ENV['PUPPET_GEM_VERSION']
Expand Down
Loading