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

modulesync 2.7.0 and drop puppet 4 #908

Merged
merged 8 commits into from May 31, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/CONTRIBUTING.md
Expand Up @@ -51,19 +51,19 @@ You can install all needed gems for spec tests into the modules directory by
running:

```sh
bundle install --path .vendor/ --without development --without system_tests --without release
bundle install --path .vendor/ --without development system_tests release
```

If you also want to run acceptance tests:

```sh
bundle install --path .vendor/ --without development --with system_tests --without release
bundle install --path .vendor/ --with system_tests --without development release
```

Our all in one solution if you don't know if you need to install or update gems:

```sh
bundle install --path .vendor/ --without development --with system_tests --without release; bundle update; bundle clean
bundle install --path .vendor/ --with system_tests --without development release; bundle update; bundle clean
```

## Syntax and style
Expand Down
10 changes: 5 additions & 5 deletions .github/PULL_REQUEST_TEMPLATE.md
Expand Up @@ -8,13 +8,13 @@ Thank you for contributing to this project!
-->
#### Pull Request (PR) description
<!--
Replace this comment with a description of your pull request.
Replace this comment with a description of your pull request.
-->

#### This Pull Request (PR) fixes the following issues
<!--
Replace this comment with the list of issues or n/a.
Use format:
Fixes #123
Fixes #124
Replace this comment with the list of issues or n/a.
Use format:
Fixes #123
Fixes #124
-->
2 changes: 1 addition & 1 deletion .msync.yml
@@ -1 +1 @@
modulesync_config_version: '2.4.0'
modulesync_config_version: '2.7.0'
1 change: 0 additions & 1 deletion .sync.yml
Expand Up @@ -11,4 +11,3 @@ Gemfile:
- gem: 'retries'
spec/spec_helper.rb:
spec_overrides: "require 'rspec/its'"
mock_with: ':rspec'
31 changes: 13 additions & 18 deletions .travis.yml
@@ -1,49 +1,44 @@
---
sudo: false
dist: xenial
language: ruby
cache: bundler
before_install:
- rm -f Gemfile.lock
- gem update --system
- gem update bundler
- bundle --version
script:
- 'bundle exec rake $CHECK'
matrix:
fast_finish: true
include:
- rvm: 2.1.9
- rvm: 2.4.4
bundler_args: --without system_tests development release
env: PUPPET_VERSION="~> 5.0" CHECK=test
- rvm: 2.5.3
bundler_args: --without system_tests development release
env: PUPPET_VERSION="~> 4.0" CHECK=test PARALLEL_TEST_PROCESSORS=12
- rvm: 2.5.1
env: PUPPET_VERSION="~> 6.0" CHECK=test_with_coveralls
- rvm: 2.5.3
bundler_args: --without system_tests development release
env: PUPPET_VERSION="~> 6.0" CHECK=rubocop
- rvm: 2.4.4
bundler_args: --without system_tests development release
env: PUPPET_VERSION="~> 5.0" CHECK=build DEPLOY_TO_FORGE=yes
- rvm: 2.5.1
- rvm: 2.5.3
bundler_args: --without development release
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=ubuntu1604-64 BEAKER_HYPERVISOR=docker CHECK=beaker
services: docker
sudo: required
- rvm: 2.5.1
- rvm: 2.5.3
bundler_args: --without development release
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_debug=true BEAKER_setfile=ubuntu1604-64 BEAKER_HYPERVISOR=docker CHECK=beaker
services: docker
sudo: required
- rvm: 2.5.1
bundler_args: --without development release
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet6-nightly BEAKER_debug=true BEAKER_setfile=ubuntu1604-64 BEAKER_HYPERVISOR=docker CHECK=beaker
services: docker
sudo: required
- rvm: 2.5.1
- rvm: 2.5.3
bundler_args: --without development release
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=centos7-64 BEAKER_HYPERVISOR=docker CHECK=beaker
services: docker
sudo: required
- rvm: 2.5.1
- rvm: 2.5.3
bundler_args: --without development release
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_debug=true BEAKER_setfile=centos7-64 BEAKER_HYPERVISOR=docker CHECK=beaker
services: docker
sudo: required
branches:
only:
- master
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Expand Up @@ -10,7 +10,7 @@ This is a manually kept file, and may not entirely reflect reality
* [#365](https://github.com/jenkinsci/puppet-jenkins/issues/365) - jenkins user and jenkins_home directory not configurable
* [#367](https://github.com/jenkinsci/puppet-jenkins/pull/367) - [puppet-jenkins#366] Replace -toolLocations with --toolLocation
* [#371](https://github.com/jenkinsci/puppet-jenkins/issues/371) - slave: INFO: Failure authenticating with BASIC 'Jenkins' 401
* [#372](https://github.com/jenkinsci/puppet-jenkins/issues/372) - Slave: swarm-client requires a cashe directory /home/jenkins-slave/.jenkins/
* [#372](https://github.com/jenkinsci/puppet-jenkins/issues/372) - Slave: swarm-client requires a cashe directory /home/jenkins-slave/.jenkins/
* [#374](https://github.com/jenkinsci/puppet-jenkins/pull/374) - add single quotes for credentials
* [#376](https://github.com/jenkinsci/puppet-jenkins/pull/376) - Add template in the jenkins::job
* [#377](https://github.com/jenkinsci/puppet-jenkins/pull/377) - Making the management of the daemon package optional
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
@@ -1,4 +1,4 @@
FROM ruby:2.5.1
FROM ruby:2.5.3

WORKDIR /opt/puppet

Expand Down
21 changes: 10 additions & 11 deletions Gemfile
Expand Up @@ -11,7 +11,7 @@ def location_for(place, fake_version = nil)
end

group :test do
gem 'puppetlabs_spec_helper', '>= 2.11.0', :require => false
gem 'puppetlabs_spec_helper', '>= 2.14.0', :require => false
gem 'rspec-puppet-facts', '>= 1.8.0', :require => false
gem 'rspec-puppet-utils', :require => false
gem 'puppet-lint-leading_zero-check', :require => false
Expand All @@ -20,16 +20,15 @@ group :test do
gem 'puppet-lint-classes_and_types_beginning_with_digits-check', :require => false
gem 'puppet-lint-unquoted_string-check', :require => false
gem 'puppet-lint-variable_contains_upcase', :require => false
gem 'puppet-lint-absolute_classname-check', :require => false
gem 'metadata-json-lint', :require => false
gem 'redcarpet', :require => false
gem 'rubocop', '~> 0.49.1', :require => false if RUBY_VERSION >= '2.3.0'
gem 'rubocop-rspec', '~> 1.15.0', :require => false if RUBY_VERSION >= '2.3.0'
gem 'rubocop', '~> 0.49.1', :require => false
gem 'rubocop-rspec', '~> 1.15.0', :require => false
gem 'mocha', '~> 1.4.0', :require => false
gem 'coveralls', :require => false
gem 'simplecov-console', :require => false
gem 'rack', '~> 1.0', :require => false if RUBY_VERSION < '2.2.2'
gem 'parallel_tests', '2.24.0', :require => false if RUBY_VERSION < '2.2.0'
gem 'parallel_tests', :require => false if RUBY_VERSION >= '2.2.0'
gem 'parallel_tests', :require => false
gem 'rspec-its', :require => false
gem 'retries', :require => false
end
Expand Down Expand Up @@ -59,16 +58,16 @@ group :system_tests do
gem 'beaker-puppet', :require => false
gem 'beaker-puppet_install_helper', :require => false
gem 'beaker-module_install_helper', :require => false
gem 'rbnacl', '>= 4', :require => false if RUBY_VERSION >= '2.2.6'
gem 'rbnacl-libsodium', :require => false if RUBY_VERSION >= '2.2.6'
gem 'rbnacl', '>= 4', :require => false
gem 'rbnacl-libsodium', :require => false
gem 'bcrypt_pbkdf', :require => false
end

group :release do
gem 'github_changelog_generator', :require => false, :git => 'https://github.com/github-changelog-generator/github-changelog-generator' if RUBY_VERSION >= '2.2.2'
gem 'github_changelog_generator', :require => false, :git => 'https://github.com/github-changelog-generator/github-changelog-generator'
gem 'puppet-blacksmith', :require => false
gem 'voxpupuli-release', :require => false, :git => 'https://github.com/voxpupuli/voxpupuli-release-gem'
gem 'puppet-strings', '>= 1.0', :require => false
gem 'puppet-strings', '>= 2.2', :require => false
end


Expand All @@ -79,7 +78,7 @@ else
gem 'facter', :require => false, :groups => [:test]
end

ENV['PUPPET_VERSION'].nil? ? puppetversion = '~> 5.0' : puppetversion = ENV['PUPPET_VERSION'].to_s
ENV['PUPPET_VERSION'].nil? ? puppetversion = '~> 6.0' : puppetversion = ENV['PUPPET_VERSION'].to_s
gem 'puppet', puppetversion, :require => false, :groups => [:test]

# vim: syntax=ruby
5 changes: 3 additions & 2 deletions NATIVE_TYPES_AND_PROVIDERS.md
Expand Up @@ -389,7 +389,7 @@ jenkins_credentials { '7e86e9fb-a8af-480f-b596-7191dc02bf38':
Using this credential type requires that the jenkins `google-oauth-plugin` plugin
has been installed.

```
```puppet
jenkins_credentials { '587690b0-f793-44e6-bc46-889cce58fb71':
ensure => 'present',
impl => 'GoogleRobotPrivateKeyCredentials',
Expand All @@ -398,7 +398,8 @@ jenkins_credentials { '587690b0-f793-44e6-bc46-889cce58fb71':
"client_email": "random@developer.gserviceaccount.com",
"private_key": "-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n"
}
| END,
| END
,
}
```
or
Expand Down
58 changes: 24 additions & 34 deletions Rakefile
Expand Up @@ -3,19 +3,12 @@ require 'puppetlabs_spec_helper/rake_tasks'
# load optional tasks for releases
# only available if gem group releases is installed
begin
require 'puppet_blacksmith/rake_tasks'
require 'voxpupuli/release/rake_tasks'
require 'puppet-strings/tasks'
rescue LoadError
end

PuppetLint.configuration.log_format = '%{path}:%{line}:%{check}:%{KIND}:%{message}'
PuppetLint.configuration.fail_on_warnings = true
PuppetLint.configuration.send('relative')
PuppetLint.configuration.send('disable_140chars')
PuppetLint.configuration.send('disable_class_inherits_from_params_class')
PuppetLint.configuration.send('disable_documentation')
PuppetLint.configuration.send('disable_single_quote_string_with_variables')
PuppetLint.configuration.absolute_classname_reverse = true

exclude_paths = %w(
pkg/**/*
Expand All @@ -28,20 +21,32 @@ PuppetSyntax.exclude_paths = exclude_paths

desc 'Auto-correct puppet-lint offenses'
task 'lint:auto_correct' do
PuppetLint.configuration.fix = true
Rake::Task[:lint].invoke
Rake::Task[:lint_fix].invoke
end

desc 'Run acceptance tests'
RSpec::Core::RakeTask.new(:acceptance) do |t|
t.pattern = 'spec/acceptance'
end

desc 'Run tests metadata_lint, release_checks'
task test: [
:metadata_lint,
:release_checks,
]
desc 'Run tests'
task test: [:release_checks]

namespace :check do
desc 'Check for trailing whitespace'
task :trailing_whitespace do
Dir.glob('**/*.md', File::FNM_DOTMATCH).sort.each do |filename|
next if filename =~ %r{^((modules|acceptance|\.?vendor|spec/fixtures|pkg)/|REFERENCE.md)}
File.foreach(filename).each_with_index do |line, index|
if line =~ %r{\s\n$}
puts "#{filename} has trailing whitespace on line #{index + 1}"
exit 1
end
end
end
end
end
Rake::Task[:release_checks].enhance ['check:trailing_whitespace']

desc "Run main 'test' task and report merged results to coveralls"
task test_with_coveralls: [:test] do
Expand All @@ -54,25 +59,10 @@ task test_with_coveralls: [:test] do
end
end

desc "Print supported beaker sets"
task 'beaker_sets', [:directory] do |t, args|
directory = args[:directory]

metadata = JSON.load(File.read('metadata.json'))

(metadata['operatingsystem_support'] || []).each do |os|
(os['operatingsystemrelease'] || []).each do |release|
if directory
beaker_set = "#{directory}/#{os['operatingsystem'].downcase}-#{release}"
else
beaker_set = "#{os['operatingsystem'].downcase}-#{release}-x64"
end

filename = "spec/acceptance/nodesets/#{beaker_set}.yml"

puts beaker_set if File.exists? filename
end
end
desc 'Generate REFERENCE.md'
task :reference, [:debug, :backtrace] do |t, args|
patterns = ''
Rake::Task['strings:generate:reference'].invoke(patterns, args[:debug], args[:backtrace])
end

begin
Expand Down
2 changes: 1 addition & 1 deletion examples/FreeBSD.pp
Expand Up @@ -9,7 +9,7 @@
package { 'openjdk':
ensure => installed,
}
-> class {'::jenkins':
-> class {'jenkins':
install_java => false,
repo => false,
}
Expand Down
2 changes: 1 addition & 1 deletion examples/OpenBSD.pp
Expand Up @@ -3,7 +3,7 @@
package { 'jre':
ensure => installed,
}
-> class {'::jenkins':
-> class {'jenkins':
install_java => false,
repo => false,
}
Expand Down
2 changes: 1 addition & 1 deletion examples/RHEL5.pp
Expand Up @@ -13,7 +13,7 @@
ensure => present,
source => 'http://pkg.jenkins-ci.org/redhat/jenkins-ci.org.key',
}
-> class {'::jenkins':
-> class {'jenkins':
install_java => false,
cli => true,
}
Expand Down
2 changes: 1 addition & 1 deletion examples/RedHatEnterpriseServer.pp
@@ -1,5 +1,5 @@
node default {
include ::jenkins
include jenkins

jenkins::plugin {
'ansicolor' :
Expand Down
2 changes: 1 addition & 1 deletion examples/Ubuntu.pp
@@ -1,5 +1,5 @@
node default {
include ::jenkins
include jenkins

jenkins::plugin {
'ansicolor' :
Expand Down
4 changes: 2 additions & 2 deletions manifests/augeas.pp
Expand Up @@ -45,8 +45,8 @@
Boolean $restart = false,
Boolean $show_diff = true,
) {
include ::jenkins
include ::jenkins::cli
include jenkins
include jenkins::cli


case $plugin {
Expand Down
4 changes: 2 additions & 2 deletions manifests/cli.pp
Expand Up @@ -7,7 +7,7 @@
fail("Use of private class ${name} by ${caller_module_name}")
}

include ::jenkins
include jenkins

# XXX Classes/defines which include the jenkins::cli class assume that they
# can use the cli even if $::jenkins::cli == false. This breaks the top
Expand Down Expand Up @@ -76,5 +76,5 @@

# jenkins::cli::reload should be included only after $::jenkins::cli::cmd is
# defined
include ::jenkins::cli::reload
include jenkins::cli::reload
}
2 changes: 1 addition & 1 deletion manifests/cli/config.pp
Expand Up @@ -21,7 +21,7 @@
Optional[String] $ssh_private_key_content = undef,
) {

if str2bool($::is_pe) {
if str2bool($facts['is_pe']) {
$gem_provider = 'pe_gem'
} elsif $::puppetversion
and (versioncmp($::puppetversion, '4.0.0') >= 0)
Expand Down
6 changes: 3 additions & 3 deletions manifests/cli/exec.pp
Expand Up @@ -8,9 +8,9 @@
Variant[String, Array] $command = $title,
) {

include ::jenkins
include ::jenkins::cli_helper
include ::jenkins::cli::reload
include jenkins
include jenkins::cli_helper
include jenkins::cli::reload

Class['jenkins::cli_helper']
-> Jenkins::Cli::Exec[$title]
Expand Down
4 changes: 2 additions & 2 deletions manifests/credentials.pp
Expand Up @@ -24,8 +24,8 @@
String $uuid = '',
){

include ::jenkins
include ::jenkins::cli_helper
include jenkins
include jenkins::cli_helper

Class['jenkins::cli_helper']
-> Jenkins::Credentials[$title]
Expand Down