Skip to content

Commit

Permalink
Merge pull request #41 from edestecd/bump-dependencies
Browse files Browse the repository at this point in the history
Bump dependencies
  • Loading branch information
edestecd committed May 28, 2020
2 parents 04fa4a1 + a92b772 commit 795ab1c
Show file tree
Hide file tree
Showing 31 changed files with 215 additions and 83 deletions.
17 changes: 13 additions & 4 deletions .fixtures.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@

# This file can be used to install module dependencies for unit testing
# See https://github.com/puppetlabs/puppetlabs_spec_helper#using-fixtures for details
---
fixtures:
repositories:
stdlib: "https://github.com/puppetlabs/puppetlabs-stdlib.git"
apt: "https://github.com/puppetlabs/puppetlabs-apt.git"
mysql: "https://github.com/puppetlabs/puppetlabs-mysql.git"
forge_modules:
apt: "puppetlabs/apt"
stdlib: "puppetlabs/stdlib"
mysql:
repo: "puppetlabs/mysql"
ref: "7.0.0"
# Extracted from core in puppet 6
cron_core: "puppetlabs/cron_core"
yumrepo_core: "puppetlabs/yumrepo_core"
symlinks:
mariadb: "#{source_dir}"
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
*.erb eol=lf
*.pp eol=lf
*.sh eol=lf
*.epp eol=lf
7 changes: 4 additions & 3 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,19 @@ cache:
before_script:
- bundle -v
- rm Gemfile.lock || true
- gem update --system
- gem update --system $RUBYGEMS_VERSION
- gem --version
- bundle -v
- bundle install --without system_tests --path vendor/bundle --jobs $(nproc)

parallel_spec-Ruby 2.1.9-Puppet ~> 4.0:
stage: syntax
stage: unit
image: ruby:2.1.9
script:
- bundle exec rake parallel_spec
variables:
PUPPET_GEM_VERSION: '~> 4.0'
RUBYGEMS_VERSION: '2.7.8'

syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop-Ruby 2.4.4-Puppet ~> 5.5:
stage: syntax
Expand All @@ -32,7 +33,7 @@ syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore c
PUPPET_GEM_VERSION: '~> 5.5'

parallel_spec-Ruby 2.4.4-Puppet ~> 5.5:
stage: syntax
stage: unit
image: ruby:2.4.4
script:
- bundle exec rake parallel_spec
Expand Down
13 changes: 13 additions & 0 deletions .pdkignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,16 @@
/convert_report.txt
/update_report.txt
.DS_Store
/appveyor.yml
/.fixtures.yml
/Gemfile
/.gitattributes
/.gitignore
/.gitlab-ci.yml
/.pdkignore
/Rakefile
/.rspec
/.rubocop.yml
/.travis.yml
/.yardopts
/spec/
1 change: 1 addition & 0 deletions .puppet-lint.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--relative
6 changes: 6 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ AllCops:
Metrics/LineLength:
Description: People have wide screens, use them.
Max: 200
GetText/DecorateString:
Description: We don't want to decorate test output.
Exclude:
- 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 Expand Up @@ -82,6 +86,8 @@ Style/StringMethods:
Enabled: true
Layout/EndOfLine:
Enabled: false
Layout/IndentHeredoc:
Enabled: false
Metrics/AbcSize:
Enabled: false
Metrics/BlockLength:
Expand Down
2 changes: 2 additions & 0 deletions .sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
# .rubocop.yml:
# include_todos: true

mock_with: ':rspec'

Gemfile:
required:
':development':
Expand Down
11 changes: 5 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
---
sudo: false
dist: trusty
language: ruby
cache: bundler
before_install:
- bundle -v
- rm -f Gemfile.lock
- gem update --system
- gem update --system $RUBYGEMS_VERSION
- gem --version
- bundle -v
script:
- 'bundle exec rake $CHECK'
bundler_args: --without system_tests
rvm:
- 2.4.1
- 2.5.1
env:
global:
- BEAKER_PUPPET_COLLECTION=puppet5 PUPPET_GEM_VERSION="~> 5.0"
- BEAKER_PUPPET_COLLECTION=puppet6 PUPPET_GEM_VERSION="~> 6.0"
matrix:
fast_finish: true
include:
Expand All @@ -25,8 +24,8 @@ matrix:
-
env: CHECK=parallel_spec
-
env: PUPPET_GEM_VERSION="~> 4.0" CHECK=parallel_spec
rvm: 2.1.9
env: PUPPET_GEM_VERSION="~> 5.0" CHECK=parallel_spec
rvm: 2.4.4
-
env: PUPPET_GEM_VERSION="~> 5.0" CHECK=build DEPLOY_TO_FORGE=yes
branches:
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
2020-03-06 (2.0.1) Brad Koby
* Stop using absolute class names
* Bump puppetlabs-apt max version
* Limit puppet puppetlabs-mysql max version (due to mysql::deepmerge removal)
* Convert PDK template to version 1.9.0
* Set mock_with to :rspec

2018-10-31 (2.0.0) Chris Edester
* Use puppet 4 compatible functions - thanks Tobias Urdin
* requires puppetlabs/mysql 6.0.0
Expand Down
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Changelog

All notable changes to this project will be documented in this file.

## Release 2.0.0

**Features**

**Bugfixes**

**Known Issues**
25 changes: 9 additions & 16 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,15 @@
source ENV['GEM_SOURCE'] || 'https://rubygems.org'

def location_for(place_or_version, fake_version = nil)
if place_or_version =~ %r{\A(git[:@][^#]*)#(.*)}
[fake_version, { git: Regexp.last_match(1), branch: Regexp.last_match(2), require: false }].compact
elsif place_or_version =~ %r{\Afile:\/\/(.*)}
['>= 0', { path: File.expand_path(Regexp.last_match(1)), require: false }]
else
[place_or_version, { require: false }]
end
end
git_url_regex = %r{\A(?<url>(https?|git)[:@][^#]*)(#(?<branch>.*))?}
file_url_regex = %r{\Afile:\/\/(?<path>.*)}

def gem_type(place_or_version)
if place_or_version =~ %r{\Agit[:@]}
:git
elsif !place_or_version.nil? && place_or_version.start_with?('file:')
:file
if place_or_version && (git_url = place_or_version.match(git_url_regex))
[fake_version, { git: git_url[:url], branch: git_url[:branch], require: false }].compact
elsif place_or_version && (file_url = place_or_version.match(file_url_regex))
['>= 0', { path: File.expand_path(file_url[:path]), require: false }]
else
:gem
[place_or_version, { require: false }]
end
end

Expand All @@ -28,7 +21,8 @@ group :development do
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::Version.new(RUBY_VERSION.dup) == Gem::Version.new('2.4.4')
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]
Expand Down Expand Up @@ -61,7 +55,6 @@ group :puppet_lint do
end

puppet_version = ENV['PUPPET_GEM_VERSION']
puppet_type = gem_type(puppet_version)
facter_version = ENV['FACTER_GEM_VERSION']
hiera_version = ENV['HIERA_GEM_VERSION']

Expand Down
70 changes: 70 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,76 @@
require 'puppetlabs_spec_helper/rake_tasks'
require 'puppet-syntax/tasks/puppet-syntax'
require 'puppet_blacksmith/rake_tasks' if Bundler.rubygems.find_name('puppet-blacksmith').any?
require 'github_changelog_generator/task' if Bundler.rubygems.find_name('github_changelog_generator').any?
require 'puppet-strings/tasks' if Bundler.rubygems.find_name('puppet-strings').any?

def changelog_user
return unless Rake.application.top_level_tasks.include? "changelog"
returnVal = nil || JSON.load(File.read('metadata.json'))['author']
raise "unable to find the changelog_user in .sync.yml, or the author in metadata.json" if returnVal.nil?
puts "GitHubChangelogGenerator user:#{returnVal}"
returnVal
end

def changelog_project
return unless Rake.application.top_level_tasks.include? "changelog"
returnVal = nil || JSON.load(File.read('metadata.json'))['name']
raise "unable to find the changelog_project in .sync.yml or the name in metadata.json" if returnVal.nil?
puts "GitHubChangelogGenerator project:#{returnVal}"
returnVal
end

def changelog_future_release
return unless Rake.application.top_level_tasks.include? "changelog"
returnVal = JSON.load(File.read('metadata.json'))['version']
raise "unable to find the future_release (version) in metadata.json" if returnVal.nil?
puts "GitHubChangelogGenerator future_release:#{returnVal}"
returnVal
end

PuppetLint.configuration.send('disable_relative')

if Bundler.rubygems.find_name('github_changelog_generator').any?
GitHubChangelogGenerator::RakeTask.new :changelog do |config|
raise "Set CHANGELOG_GITHUB_TOKEN environment variable eg 'export CHANGELOG_GITHUB_TOKEN=valid_token_here'" if Rake.application.top_level_tasks.include? "changelog" and ENV['CHANGELOG_GITHUB_TOKEN'].nil?
config.user = "#{changelog_user}"
config.project = "#{changelog_project}"
config.future_release = "#{changelog_future_release}"
config.exclude_labels = ['maintenance']
config.header = "# Change log\n\nAll notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org)."
config.add_pr_wo_labels = true
config.issues = false
config.merge_prefix = "### UNCATEGORIZED PRS; GO LABEL THEM"
config.configure_sections = {
"Changed" => {
"prefix" => "### Changed",
"labels" => ["backwards-incompatible"],
},
"Added" => {
"prefix" => "### Added",
"labels" => ["feature", "enhancement"],
},
"Fixed" => {
"prefix" => "### Fixed",
"labels" => ["bugfix"],
},
}
end
else
desc 'Generate a Changelog from GitHub'
task :changelog do
raise <<EOM
The changelog tasks depends on unreleased features of the github_changelog_generator gem.
Please manually add it to your .sync.yml for now, and run `pdk update`:
---
Gemfile:
optional:
':development':
- gem: 'github_changelog_generator'
git: 'https://github.com/skywinder/github-changelog-generator'
ref: '20ee04ba1234e9e83eb2ffb5056e23d641c7a018'
condition: "Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.2.2')"
EOM
end
end

19 changes: 11 additions & 8 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
---
version: 1.1.x.{build}
branches:
only:
- master
skip_commits:
message: /^\(?doc\)?.*/
clone_depth: 10
Expand All @@ -14,14 +17,6 @@ environment:
-
RUBY_VERSION: 24-x64
CHECK: syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop
-
PUPPET_GEM_VERSION: ~> 4.0
RUBY_VERSION: 21
CHECK: parallel_spec
-
PUPPET_GEM_VERSION: ~> 4.0
RUBY_VERSION: 21-x64
CHECK: parallel_spec
-
PUPPET_GEM_VERSION: ~> 5.0
RUBY_VERSION: 24
Expand All @@ -30,6 +25,14 @@ environment:
PUPPET_GEM_VERSION: ~> 5.0
RUBY_VERSION: 24-x64
CHECK: parallel_spec
-
PUPPET_GEM_VERSION: ~> 6.0
RUBY_VERSION: 25
CHECK: parallel_spec
-
PUPPET_GEM_VERSION: ~> 6.0
RUBY_VERSION: 25-x64
CHECK: parallel_spec
matrix:
fast_finish: true
install:
Expand Down
1 change: 1 addition & 0 deletions data/common.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
---
10 changes: 10 additions & 0 deletions hiera.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
version: 5

defaults: # Used for any hierarchy level that omits these keys.
datadir: data # This path is relative to hiera.yaml's directory.
data_hash: yaml_data # Use the built-in YAML backend.

hierarchy:
- name: 'common'
path: 'common.yaml'
2 changes: 1 addition & 1 deletion manifests/backup/mysqldump.pp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
$optional_args = [],
) inherits mariadb::params {

include '::mariadb::cluster'
include 'mariadb::cluster'

if $backupcompress {
ensure_packages(['bzip2'])
Expand Down
6 changes: 3 additions & 3 deletions manifests/client.pp
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@
$options = mysql::deepmerge($mariadb::params::client_default_options, $override_options)

if $manage_repo {
class { '::mariadb::repo':
class { 'mariadb::repo':
repo_version => $repo_version,
}
}

anchor { 'mariadb::client::start': }
-> class { '::mariadb::client::mysql': }
-> class { '::mariadb::client::config': }
-> class { 'mariadb::client::mysql': }
-> class { 'mariadb::client::config': }
-> anchor { 'mariadb::client::end': }
}
4 changes: 2 additions & 2 deletions manifests/client/mysql.pp
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
$dev = $mariadb::client::dev,
){

class { '::mysql::client':
class { 'mysql::client':
package_ensure => installed,
package_name => $mariadb::params::client_package_name,
}

if $dev {
class { '::mysql::bindings':
class { 'mysql::bindings':
client_dev => true,
client_dev_package_ensure => installed,
client_dev_package_name => $mariadb::params::devel_package_name,
Expand Down

0 comments on commit 795ab1c

Please sign in to comment.