diff --git a/.travis.yml b/.travis.yml index 5e9078a5..f7bff8a4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,5 @@ +script: ./script/cibuild rvm: 1.8.7 -branches: - only: - - master notifications: email: - tim@github.com diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..1e43e5b1 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,28 @@ +Thanks for contributing to puppet-logrotate! A couple of notes to help you out: + + * Please don't bump the module version number. + * Make sure your changes have tests. + * Keep your pull requests on topic. Pull requests with a bunch of unrelated + changes won't get merged. Feel free to open seperate pull requests for the + other changes though. + * Yes, I commit vendored gem files into my repositories. No, this is not + a mistake. Please don't "fix" this in your pull request :) + +Before starting, you can prepare your development environment by running: + +``` +script/bootstap +``` + +This will install all the dependencies required to run the test suite. + +Although TravisCI will automatically run the test suite against your branch +when you push, you can (and should) run them locally as you're working. You can +run the test suite by running: + +``` +script/cibuild +``` + +This will run all the rspec-puppet tests followed by puppet-lint to catch any +style issues. diff --git a/Gemfile b/Gemfile index f119bf58..72d395e2 100644 --- a/Gemfile +++ b/Gemfile @@ -2,7 +2,6 @@ source 'https://rubygems.org' puppetversion = ENV.key?('PUPPET_VERSION') ? "= #{ENV['PUPPET_VERSION']}" : ['>= 3.2'] -gem 'rake' gem 'puppet-lint' gem 'rspec-puppet' gem 'puppetlabs_spec_helper' diff --git a/Gemfile.lock b/Gemfile.lock index 97a89645..52fb0853 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,21 +2,25 @@ GEM remote: https://rubygems.org/ specs: diff-lcs (1.2.4) - facter (1.6.18) - hiera (1.0.0) + facter (1.7.1) + hiera (1.2.1) + json_pure + json_pure (1.8.0) metaclass (0.0.1) mocha (0.14.0) metaclass (~> 0.0.1) - puppet (3.0.2) - facter (~> 1.6.11) - hiera (~> 1.0.0) + puppet (3.2.1) + facter (~> 1.6) + hiera (~> 1.0) + rgen (~> 0.6) puppet-lint (0.3.2) puppetlabs_spec_helper (0.4.1) mocha (>= 0.10.5) rake rspec (>= 2.9.0) rspec-puppet (>= 0.1.1) - rake (0.9.2.2) + rake (10.0.4) + rgen (0.6.2) rspec (2.13.0) rspec-core (~> 2.13.0) rspec-expectations (~> 2.13.0) @@ -32,8 +36,7 @@ PLATFORMS ruby DEPENDENCIES - puppet (= 3.0.2) + puppet (>= 3.2) puppet-lint puppetlabs_spec_helper - rake rspec-puppet diff --git a/README.md b/README.md index 6ec97e18..3c9773a6 100644 --- a/README.md +++ b/README.md @@ -88,7 +88,7 @@ lastaction - A command String that should be execute by /bin/sh once rotate - The Integer number of rotated log files to keep on disk (optional). rotate_every - How often the log files should be rotated as a String. - Valid values are 'day', 'week', 'month' and 'year' + Valid values are 'hour', 'day', 'week', 'month' and 'year' (optional). Please note, older versions of logrotate do not support yearly log rotation. size - The String size a log file has to reach before it will be diff --git a/Rakefile b/Rakefile deleted file mode 100644 index 733330f4..00000000 --- a/Rakefile +++ /dev/null @@ -1,17 +0,0 @@ -require 'rake' - -begin - require 'rspec/core/rake_task' - require 'puppet-lint/tasks/puppet-lint' -rescue LoadError - require 'rubygems' - retry -end - -RSpec::Core::RakeTask.new(:spec) do |t| - t.pattern = 'spec/*/*_spec.rb' -end - -task :test => [:spec, :lint] - -task :default => :test diff --git a/script/bootstrap b/script/bootstrap new file mode 100755 index 00000000..06957979 --- /dev/null +++ b/script/bootstrap @@ -0,0 +1,3 @@ +#!/usr/bin/env sh + +bundle install --path vendor/gems --local diff --git a/script/cibuild b/script/cibuild new file mode 100755 index 00000000..d1c8c066 --- /dev/null +++ b/script/cibuild @@ -0,0 +1,9 @@ +#!/usr/bin/env sh + +set -e + +[ -z "${PUPPET_VERSION}" ] && script/bootstrap + +bundle exec rspec + +bundle exec puppet-lint --with-filename --fail-on-warnings manifests diff --git a/vendor/cache/facter-1.6.18.gem b/vendor/cache/facter-1.6.18.gem deleted file mode 100644 index 9e1e5a34..00000000 Binary files a/vendor/cache/facter-1.6.18.gem and /dev/null differ diff --git a/vendor/cache/facter-1.7.1.gem b/vendor/cache/facter-1.7.1.gem new file mode 100644 index 00000000..de512619 Binary files /dev/null and b/vendor/cache/facter-1.7.1.gem differ diff --git a/vendor/cache/hiera-1.0.0.gem b/vendor/cache/hiera-1.0.0.gem deleted file mode 100644 index 74a7dbe1..00000000 Binary files a/vendor/cache/hiera-1.0.0.gem and /dev/null differ diff --git a/vendor/cache/hiera-1.2.1.gem b/vendor/cache/hiera-1.2.1.gem new file mode 100644 index 00000000..cad36e17 Binary files /dev/null and b/vendor/cache/hiera-1.2.1.gem differ diff --git a/vendor/cache/json_pure-1.8.0.gem b/vendor/cache/json_pure-1.8.0.gem new file mode 100644 index 00000000..6486fa0d Binary files /dev/null and b/vendor/cache/json_pure-1.8.0.gem differ diff --git a/vendor/cache/puppet-3.0.2.gem b/vendor/cache/puppet-3.0.2.gem deleted file mode 100644 index b2bd3837..00000000 Binary files a/vendor/cache/puppet-3.0.2.gem and /dev/null differ diff --git a/vendor/cache/puppet-3.2.1.gem b/vendor/cache/puppet-3.2.1.gem new file mode 100644 index 00000000..853170bf Binary files /dev/null and b/vendor/cache/puppet-3.2.1.gem differ diff --git a/vendor/cache/rake-0.9.2.2.gem b/vendor/cache/rake-0.9.2.2.gem deleted file mode 100644 index f7239ac2..00000000 Binary files a/vendor/cache/rake-0.9.2.2.gem and /dev/null differ diff --git a/vendor/cache/rake-10.0.4.gem b/vendor/cache/rake-10.0.4.gem new file mode 100644 index 00000000..773869c2 Binary files /dev/null and b/vendor/cache/rake-10.0.4.gem differ diff --git a/vendor/cache/rgen-0.6.2.gem b/vendor/cache/rgen-0.6.2.gem new file mode 100644 index 00000000..8306d99c Binary files /dev/null and b/vendor/cache/rgen-0.6.2.gem differ