Skip to content
This repository was archived by the owner on May 5, 2023. It is now read-only.

Commit a072d87

Browse files
committed
Modulesync 20160319
1 parent aa8d67c commit a072d87

24 files changed

+239
-92
lines changed

.gitignore

+10-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1-
.*.sw?
2-
pkg
3-
spec/fixtures
4-
.rspec_system
5-
.vagrant
1+
pkg/
62
Gemfile.lock
3+
vendor/
4+
spec/fixtures/
5+
.vagrant/
6+
.bundle/
7+
coverage/
8+
log/
9+
.idea/
10+
*.iml
11+
.*.sw

.rspec

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
--format documentation
2+
--color

.rubocop.yml

+40-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
AllCops:
2+
Include:
3+
- ./**/*.rb
24
Exclude:
35
- vendor/**/*
46
- pkg/**/*
@@ -8,14 +10,36 @@ AllCops:
810
Metrics/LineLength:
911
Max: 328
1012

11-
# dealbreaker:
12-
Style/TrailingComma:
13+
# 'Complexity' is very relative
14+
Metrics/PerceivedComplexity:
1315
Enabled: false
14-
Style/ClosingParenthesisIndentation:
16+
17+
# 'Complexity' is very relative
18+
Metrics/CyclomaticComplexity:
19+
Enabled: false
20+
21+
# 'Complexity' is very relative
22+
Metrics/AbcSize:
1523
Enabled: false
1624

17-
# we still support ruby 1.8
18-
Style/HashSyntax:
25+
# Method length is not necessarily an indicator of code quality
26+
Metrics/MethodLength:
27+
Enabled: false
28+
29+
# Module length is not necessarily an indicator of code quality
30+
Metrics/ModuleLength:
31+
Enabled: false
32+
33+
# Class length is not necessarily an indicator of code quality
34+
Metrics/ClassLength:
35+
Enabled: false
36+
37+
# dealbreaker:
38+
Style/TrailingCommaInArguments:
39+
Enabled: false
40+
Style/TrailingCommaInLiteral:
41+
Enabled: false
42+
Style/ClosingParenthesisIndentation:
1943
Enabled: false
2044

2145
Lint/AmbiguousRegexpLiteral:
@@ -29,3 +53,14 @@ Style/WordArray:
2953
# providers
3054
Style/ClassAndModuleChildren:
3155
Enabled: false
56+
57+
Style/Documentation:
58+
Description: 'Document classes and non-namespace modules.'
59+
Enabled: false
60+
61+
# More comfortable block layouts
62+
Style/BlockDelimiters:
63+
Enabled: False
64+
65+
Style/MultilineBlockLayout:
66+
Enabled: False

.travis.yml

+16-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
---
2-
notifications:
3-
email: false
42
sudo: false
53
language: ruby
64
cache: bundler
@@ -11,18 +9,27 @@ script:
119
matrix:
1210
fast_finish: true
1311
include:
14-
- rvm: 1.9.3
15-
env: PUPPET_VERSION="~> 3.4" CHECK=test
1612
- rvm: 1.9.3
1713
env: PUPPET_VERSION="~> 3.0" STRICT_VARIABLES="yes" CHECK=test
18-
- rvm: 2.1.6
14+
- rvm: 2.1.8
1915
env: PUPPET_VERSION="~> 3.0" STRICT_VARIABLES="yes" CHECK=test
20-
- rvm: 2.1.6
16+
- rvm: 1.9.3
17+
env: PUPPET_VERSION="~> 3.0" STRICT_VARIABLES="yes" CHECK=test FUTURE_PARSER=yes
18+
- rvm: 2.1.8
19+
env: PUPPET_VERSION="~> 3.0" STRICT_VARIABLES="yes" CHECK=test FUTURE_PARSER=yes
20+
- rvm: 2.1.8
2121
env: PUPPET_VERSION="~> 4.0" STRICT_VARIABLES="yes" CHECK=test
22-
- rvm: 2.2.3
22+
- rvm: 2.2.4
2323
env: PUPPET_VERSION="~> 4.0" STRICT_VARIABLES="yes" CHECK=test
24-
- rvm: 2.2.3
24+
- rvm: 2.2.4
2525
env: PUPPET_VERSION="~> 4.0" STRICT_VARIABLES="yes" CHECK=rubocop
26+
- rvm: 2.3.0
27+
env: PUPPET_VERSION="~> 4.0" STRICT_VARIABLES="yes" CHECK=test
28+
allow_failures:
29+
- rvm: 2.3.0
30+
env: PUPPET_VERSION="~> 4.0" STRICT_VARIABLES="yes" CHECK=test
31+
notifications:
32+
email: false
2633
deploy:
2734
provider: puppetforge
2835
user: puppet
@@ -34,3 +41,4 @@ deploy:
3441
all_branches: true
3542
# Only publish if our main Ruby target builds
3643
rvm: 1.9.3
44+
condition: "$FUTURE_PARSER = yes"

CONTRIBUTING.md

+17-4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ will likely make it into a release a little quicker.
55

66
## Contributing
77

8+
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms. [Contributor Code of Conduct](https://voxpupuli.org/coc/).
9+
810
1. Fork the repo.
911

1012
1. Create a separate branch for your change.
@@ -47,18 +49,29 @@ The test suite will run [Puppet Lint](http://puppet-lint.com/) and
4749
[Puppet Syntax](https://github.com/gds-operations/puppet-syntax) to
4850
check various syntax and style things. You can run these locally with:
4951

50-
bundle exec rake test
52+
bundle exec rake lint
53+
bundle exec rake validate
5154

5255
## Running the unit tests
5356

5457
The unit test suite covers most of the code, as mentioned above please
5558
add tests if you're adding new functionality. If you've not used
5659
[rspec-puppet](http://rspec-puppet.com/) before then feel free to ask
57-
about how best to test your new feature. To run your specific spec test
58-
you can pass it to `SPEC`:
60+
about how best to test your new feature.
61+
62+
To run your all the unit tests
63+
64+
bundle exec rake spec SPEC_OPTS='--format documentation'
65+
66+
To run a specific spec test set the `SPEC` variable:
5967

6068
bundle exec rake spec SPEC=spec/foo_spec.rb
6169

70+
To run the linter, the syntax checker and the unit tests:
71+
72+
bundle exec rake test
73+
74+
6275
## Integration tests
6376

6477
The unit tests just check the code runs, not that it does exactly what
@@ -74,7 +87,7 @@ with:
7487
This will run the tests on an Ubuntu 12.04 virtual machine. You can also
7588
run the integration tests against Centos 6.5 with.
7689

77-
RS_SET=centos-64-x64 bundle exec rake acceptances
90+
BEAKER_set=centos-64-x64 bundle exec rake acceptances
7891

7992
If you don't want to have to recreate the virtual machine every time you
8093
can use `BEAKER_DESTROY=no` and `BEAKER_PROVISION=no`. On the first run you will

Gemfile

+55-22
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,64 @@
1-
source 'https://rubygems.org'
1+
source ENV['GEM_SOURCE'] || "https://rubygems.org"
2+
3+
def location_for(place, fake_version = nil)
4+
if place =~ /^(git[:@][^#]*)#(.*)/
5+
[fake_version, { :git => $1, :branch => $2, :require => false }].compact
6+
elsif place =~ /^file:\/\/(.*)/
7+
['>= 0', { :path => File.expand_path($1), :require => false }]
8+
else
9+
[place, { :require => false }]
10+
end
11+
end
212

313
group :test do
4-
gem 'rake'
5-
gem 'puppet', ENV['PUPPET_VERSION'] || '~> 3.8.0'
6-
gem 'rspec-puppet', git: 'https://github.com/rodjek/rspec-puppet.git'
7-
gem 'puppetlabs_spec_helper'
8-
gem 'metadata-json-lint'
9-
gem 'rspec-puppet-facts'
10-
gem 'rspec'
11-
gem 'puppet-blacksmith'
12-
gem 'rubocop'
13-
gem 'puppet-lint-absolute_classname-check'
14-
gem 'puppet-lint-leading_zero-check'
15-
gem 'puppet-lint-trailing_comma-check'
16-
gem 'puppet-lint-version_comparison-check'
17-
gem 'puppet-lint-classes_and_types_beginning_with_digits-check'
18-
gem 'puppet-lint-unquoted_string-check'
19-
gem 'puppet-lint-variable_contains_upcase'
14+
gem 'rake', :require => false
15+
gem 'rspec-puppet', :require => false, :git => 'https://github.com/rodjek/rspec-puppet.git'
16+
gem 'puppet-lint', :require => false, :git => 'https://github.com/rodjek/puppet-lint.git'
17+
gem 'metadata-json-lint', :require => false
18+
gem 'rspec-puppet-facts', :require => false
19+
gem 'rspec', :require => false
20+
gem 'puppet-blacksmith', :require => false, :git => 'https://github.com/voxpupuli/puppet-blacksmith.git'
21+
gem 'voxpupuli-release', :require => false, :git => 'https://github.com/voxpupuli/voxpupuli-release-gem.git'
22+
gem 'rubocop', '~> 0.38', :require => false
23+
gem 'rspec-puppet-utils', :require => false
24+
gem 'puppetlabs_spec_helper', :require => false
25+
gem 'puppet-lint-absolute_classname-check', :require => false
26+
gem 'puppet-lint-leading_zero-check', :require => false
27+
gem 'puppet-lint-trailing_comma-check', :require => false
28+
gem 'puppet-lint-version_comparison-check', :require => false
29+
gem 'puppet-lint-classes_and_types_beginning_with_digits-check', :require => false
30+
gem 'puppet-lint-unquoted_string-check', :require => false
31+
gem 'puppet-lint-variable_contains_upcase', :require => false
2032
end
2133

2234
group :development do
23-
gem 'travis'
24-
gem 'travis-lint'
25-
gem 'guard-rake'
35+
gem 'travis', :require => false
36+
gem 'travis-lint', :require => false
37+
gem 'guard-rake', :require => false
2638
end
2739

2840
group :system_tests do
29-
gem 'beaker'
30-
gem 'beaker-rspec'
41+
gem 'beaker', :require => false
42+
if beaker_version = ENV['BEAKER_VERSION']
43+
gem 'beaker', *location_for(beaker_version)
44+
end
45+
if beaker_rspec_version = ENV['BEAKER_RSPEC_VERSION']
46+
gem 'beaker-rspec', *location_for(beaker_rspec_version)
47+
else
48+
gem 'beaker-rspec', :require => false
49+
end
50+
gem 'beaker-puppet_install_helper', :require => false
51+
end
52+
53+
54+
55+
if facterversion = ENV['FACTER_GEM_VERSION']
56+
gem 'facter', facterversion.to_s, :require => false, :groups => [:test]
57+
else
58+
gem 'facter', :require => false, :groups => [:test]
3159
end
60+
61+
ENV['PUPPET_VERSION'].nil? ? puppetversion = '~> 3.0' : puppetversion = ENV['PUPPET_VERSION'].to_s
62+
gem 'puppet', puppetversion, :require => false, :groups => [:test]
63+
64+
# vim:ft=ruby

README.md

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
# Staging module for Puppet
1+
# Puppet Stagin
22

3-
Manages staging directory, along with download/extraction of compressed files.
3+
[![Puppet Forge](http://img.shields.io/puppetforge/v/puppet/staging.svg)](https://forge.puppetlabs.com/puppet/staging)
4+
[![Puppet Forge downloads](https://img.shields.io/puppetforge/dt/puppet/staging.svg)](https://forge.puppetlabs.com/puppet/staging)
5+
[![Puppet Forge score](https://img.shields.io/puppetforge/f/puppet/staging.svg)](https://forge.puppetlabs.com/puppet/staging)
6+
[![Build Status](https://travis-ci.org/voxpupuli/puppet-staging.png)](https://travis-ci.org/voxpupuli/puppet-staging)
47

5-
[![Build Status](https://secure.travis-ci.org/voxpupuli/puppet-staging.png?branch=master)](http://travis-ci.org/voxpupuli/puppet-staging)
8+
Manages staging directory, along with download/extraction of compressed files.
69

710
WARNING: Version 0.2.0 no longer uses hiera functions. The same behavior should be available in Puppet 3.0.
811

@@ -63,7 +66,7 @@ Staging files currently support the following source:
6366

6467
Primarily authored by Nan Liu
6568

66-
## Contributor
69+
## Contributors
6770

6871
* Adrien Thebo
6972
* gizero

Rakefile

+5-26
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,18 @@ require 'puppet-lint/tasks/puppet-lint'
33
require 'puppet-syntax/tasks/puppet-syntax'
44
require 'metadata-json-lint/rake_task'
55
require 'puppet_blacksmith/rake_tasks'
6+
require 'voxpupuli/release/rake_tasks'
67
require 'rubocop/rake_task'
78

89
RuboCop::RakeTask.new
910

10-
PuppetLint.configuration.relative = true
11-
PuppetLint.configuration.send('disable_80chars')
1211
PuppetLint.configuration.log_format = '%{path}:%{linenumber}:%{check}:%{KIND}:%{message}'
1312
PuppetLint.configuration.fail_on_warnings = true
14-
15-
# Forsake support for Puppet 2.6.2 for the benefit of cleaner code.
16-
# http://puppet-lint.com/checks/class_parameter_defaults/
17-
PuppetLint.configuration.send('disable_class_parameter_defaults')
18-
# http://puppet-lint.com/checks/class_inherits_from_params_class/
13+
PuppetLint.configuration.send('relative')
14+
PuppetLint.configuration.send('disable_140chars')
1915
PuppetLint.configuration.send('disable_class_inherits_from_params_class')
16+
PuppetLint.configuration.send('disable_documentation')
17+
PuppetLint.configuration.send('disable_single_quote_string_with_variables')
2018

2119
exclude_paths = %w(
2220
pkg/**/*
@@ -38,22 +36,3 @@ task test: [
3836
:syntax,
3937
:spec,
4038
]
41-
42-
Blacksmith::RakeTask.new do |t|
43-
t.build = false # do not build the module nor push it to the Forge
44-
# just do the tagging [:clean, :tag, :bump_commit]
45-
end
46-
47-
desc 'Offload release process to Travis.'
48-
task travis_release: [
49-
:check_changelog, # check that the changelog contains an entry for the current release
50-
:"module:release", # do everything except build / push to forge, travis will do that for us
51-
]
52-
53-
desc 'Check Changelog.'
54-
task :check_changelog do
55-
v = Blacksmith::Modulefile.new.version
56-
if File.readlines('CHANGELOG.md').grep(/Releasing #{v}/).size == 0
57-
fail "Unable to find a CHANGELOG.md entry for the #{v} release."
58-
end
59-
end

manifests/extract.pp

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
$subdir = $caller_module_name #: subdir per module in staging directory.
1414
) {
1515

16-
include staging
16+
include ::staging
1717

1818
if $source {
1919
$source_path = $source

manifests/file.pp

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
$subdir = $caller_module_name
2525
) {
2626

27-
include staging
27+
include ::staging
2828

2929
$quoted_source = shellquote($source)
3030

metadata.json

+7-6
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,15 @@
9595
"version_requirement": ">=2.7.0"
9696
}
9797
],
98-
"name": "nanliu-staging",
98+
"name": "puppet-staging",
99+
"description": "Manages compressed file staging and deployment.",
99100
"version": "1.0.4",
100-
"source": "git://github.com/nanliu/puppet-staging",
101-
"author": "Nan Liu",
102-
"license": "Apache-2.0",
101+
"author": "voxpupuli",
103102
"summary": "Compressed file staging and deployment",
104-
"description": "Manages compressed file staging and deployment.",
105-
"project_page": "https://github.com/nanliu/puppet-staging",
103+
"license": "Apache-2.0",
104+
"source": "https://github.com/voxpupuli/puppet-staging",
105+
"project_page": "https://github.com/voxpupuli/puppet-staging",
106+
"issues_url": "https://github.com/voxpupuli/puppet-staging/issues",
106107
"dependencies": [
107108

108109
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
HOSTS:
2+
centos-511-x64:
3+
roles:
4+
- master
5+
platform: el-5-x86_64
6+
box: puppetlabs/centos-5.11-64-nocm
7+
hypervisor: vagrant
8+
CONFIG:
9+
type: foss

0 commit comments

Comments
 (0)