Skip to content

Commit c7c292a

Browse files
committed
(MODULES-7625) - Applied fix for GemFile dependencies and executed pdk update
1 parent dcf00bd commit c7c292a

9 files changed

Lines changed: 102 additions & 11 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.git/
12
.*.sw[op]
23
.metadata
34
.yardoc

.pdkignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.git/
12
.*.sw[op]
23
.metadata
34
.yardoc

.rubocop.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ RSpec/MessageSpies:
7171
Style/Documentation:
7272
Exclude:
7373
- lib/puppet/parser/functions/**/*
74+
- spec/**/*
7475
Style/WordArray:
7576
EnforcedStyle: brackets
7677
Style/CollectionMethods:
@@ -81,6 +82,8 @@ Style/StringMethods:
8182
Enabled: true
8283
Layout/EndOfLine:
8384
Enabled: false
85+
Layout/IndentHeredoc:
86+
Enabled: false
8487
Metrics/AbcSize:
8588
Enabled: false
8689
Metrics/BlockLength:

.sync.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@
1010
- release
1111

1212
Gemfile:
13+
optional:
14+
':development':
15+
- gem: net-telnet
16+
version: '0.1.0'
17+
condition: "Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.3.0')"
18+
- gem: net-telnet
19+
condition: "Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.3.0')"
1320
required:
1421
':system_tests':
1522
- gem: 'puppet-module-posix-system-r#{minor_version}'

.travis.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ script:
1313
- 'bundle exec rake $CHECK'
1414
bundler_args: --without system_tests
1515
rvm:
16-
- 2.4.1
16+
- 2.4.4
1717
env:
1818
global:
1919
- BEAKER_PUPPET_COLLECTION=puppet5 PUPPET_GEM_VERSION="~> 5.0"
@@ -23,16 +23,16 @@ matrix:
2323
-
2424
bundler_args:
2525
dist: trusty
26-
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_set=docker/centos-7
27-
rvm: 2.4.1
26+
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_set=docker/centos-7 BEAKER_TESTMODE=apply
27+
rvm: 2.4.4
2828
script: bundle exec rake beaker
2929
services: docker
3030
sudo: required
3131
-
3232
bundler_args:
3333
dist: trusty
34-
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_set=docker/ubuntu-14.04
35-
rvm: 2.4.1
34+
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_set=docker/ubuntu-14.04 BEAKER_TESTMODE=apply
35+
rvm: 2.4.4
3636
script: bundle exec rake beaker
3737
services: docker
3838
sudo: required
@@ -45,9 +45,9 @@ matrix:
4545
rvm: 2.1.9
4646
branches:
4747
only:
48-
- master
49-
- /^v\d/
50-
- release
48+
- master
49+
- /^v\d/
50+
- release
5151
notifications:
5252
email: false
5353
deploy:

Gemfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ group :development do
3333
gem "puppet-module-posix-dev-r#{minor_version}", require: false, platforms: [:ruby]
3434
gem "puppet-module-win-default-r#{minor_version}", require: false, platforms: [:mswin, :mingw, :x64_mingw]
3535
gem "puppet-module-win-dev-r#{minor_version}", require: false, platforms: [:mswin, :mingw, :x64_mingw]
36-
gem "puppet-blacksmith", '~> 3.4', require: false, platforms: [:ruby]
36+
gem "net-telnet", '0.1.0', require: false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.3.0')
37+
gem "net-telnet", require: false if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.3.0')
3738
end
3839
group :system_tests do
3940
gem "puppet-module-posix-system-r#{minor_version}", require: false, platforms: [:ruby]

Rakefile

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,75 @@
11
require 'puppetlabs_spec_helper/rake_tasks'
22
require 'puppet-syntax/tasks/puppet-syntax'
33
require 'puppet_blacksmith/rake_tasks' if Bundler.rubygems.find_name('puppet-blacksmith').any?
4+
require 'github_changelog_generator/task' if Bundler.rubygems.find_name('github_changelog_generator').any?
5+
6+
def changelog_user
7+
return unless Rake.application.top_level_tasks.include? "changelog"
8+
returnVal = nil || JSON.load(File.read('metadata.json'))['author']
9+
raise "unable to find the changelog_user in .sync.yml, or the author in metadata.json" if returnVal.nil?
10+
puts "GitHubChangelogGenerator user:#{returnVal}"
11+
returnVal
12+
end
13+
14+
def changelog_project
15+
return unless Rake.application.top_level_tasks.include? "changelog"
16+
returnVal = nil || JSON.load(File.read('metadata.json'))['name']
17+
raise "unable to find the changelog_project in .sync.yml or the name in metadata.json" if returnVal.nil?
18+
puts "GitHubChangelogGenerator project:#{returnVal}"
19+
returnVal
20+
end
21+
22+
def changelog_future_release
23+
return unless Rake.application.top_level_tasks.include? "changelog"
24+
returnVal = JSON.load(File.read('metadata.json'))['version']
25+
raise "unable to find the future_release (version) in metadata.json" if returnVal.nil?
26+
puts "GitHubChangelogGenerator future_release:#{returnVal}"
27+
returnVal
28+
end
429

530
PuppetLint.configuration.send('disable_relative')
631

32+
if Bundler.rubygems.find_name('github_changelog_generator').any?
33+
GitHubChangelogGenerator::RakeTask.new :changelog do |config|
34+
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?
35+
config.user = "#{changelog_user}"
36+
config.project = "#{changelog_project}"
37+
config.future_release = "#{changelog_future_release}"
38+
config.exclude_labels = ['maintenance']
39+
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)."
40+
config.add_pr_wo_labels = true
41+
config.issues = false
42+
config.merge_prefix = "### UNCATEGORIZED PRS; GO LABEL THEM"
43+
config.configure_sections = {
44+
"Changed" => {
45+
"prefix" => "### Changed",
46+
"labels" => ["backwards-incompatible"],
47+
},
48+
"Added" => {
49+
"prefix" => "### Added",
50+
"labels" => ["feature", "enhancement"],
51+
},
52+
"Fixed" => {
53+
"prefix" => "### Fixed",
54+
"labels" => ["bugfix"],
55+
},
56+
}
57+
end
58+
else
59+
desc 'Generate a Changelog from GitHub'
60+
task :changelog do
61+
raise <<EOM
62+
The changelog tasks depends on unreleased features of the github_changelog_generator gem.
63+
Please manually add it to your .sync.yml for now, and run `pdk update`:
64+
---
65+
Gemfile:
66+
optional:
67+
':development':
68+
- gem: 'github_changelog_generator'
69+
git: 'https://github.com/skywinder/github-changelog-generator'
70+
ref: '20ee04ba1234e9e83eb2ffb5056e23d641c7a018'
71+
condition: "Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.2.2')"
72+
EOM
73+
end
74+
end
75+

metadata.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,6 @@
9595
}
9696
],
9797
"template-url": "https://github.com/puppetlabs/pdk-templates",
98-
"template-ref": "heads/master-0-g34e3266",
99-
"pdk-version": "1.5.0"
98+
"template-ref": "1.6.1-0-g6b0d497",
99+
"pdk-version": "1.6.1"
100100
}

spec/spec_helper.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,12 @@
3434
Puppet.settings[:strict] = :warning
3535
end
3636
end
37+
38+
def ensure_module_defined(module_name)
39+
module_name.split('::').reduce(Object) do |last_module, next_module|
40+
last_module.const_set(next_module, Module.new) unless last_module.const_defined?(next_module)
41+
last_module.const_get(next_module)
42+
end
43+
end
44+
45+
# 'spec_overrides' from sync.yml will appear below this line

0 commit comments

Comments
 (0)