diff --git a/.fixtures.yml b/.fixtures.yml new file mode 100644 index 0000000..d8e80c6 --- /dev/null +++ b/.fixtures.yml @@ -0,0 +1,3 @@ +fixtures: + symlinks: + ldapquery: "#{source_dir}" diff --git a/.rspec b/.rspec new file mode 100644 index 0000000..8c18f1a --- /dev/null +++ b/.rspec @@ -0,0 +1,2 @@ +--format documentation +--color diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..10f2fc3 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,37 @@ +--- +language: ruby +bundler_args: --without development system_tests +before_install: rm Gemfile.lock || true +rvm: + - 1.9.3 + - 2.0.0 + - 2.1.0 +script: bundle exec rake test +env: + - PUPPET_VERSION="~> 2.7.0" + - PUPPET_VERSION="~> 3.2.0" + - PUPPET_VERSION="~> 3.3.0" + - PUPPET_VERSION="~> 3.4.0" + - PUPPET_VERSION="~> 3.5.0" STRICT_VARIABLES=yes + - PUPPET_VERSION="~> 3.6.0" STRICT_VARIABLES=yes + - PUPPET_VERSION="~> 3.7.0" STRICT_VARIABLES=yes + - PUPPET_VERSION="~> 3.7.0" STRICT_VARIABLES=yes FUTURE_PARSER=yes +matrix: + exclude: + # Ruby 1.9.3 + - rvm: 1.9.3 + env: PUPPET_VERSION="~> 2.7.0" + + # Ruby 2.0.0 + - rvm: 2.0.0 + env: PUPPET_VERSION="~> 2.7.0" + + # Ruby 2.1.0 + - rvm: 2.1.0 + env: PUPPET_VERSION="~> 2.7.0" + - rvm: 2.1.0 + env: PUPPET_VERSION="~> 3.2.0" + - rvm: 2.1.0 + env: PUPPET_VERSION="~> 3.3.0" + - rvm: 2.1.0 + env: PUPPET_VERSION="~> 3.4.0" diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..8e87698 --- /dev/null +++ b/Gemfile @@ -0,0 +1,24 @@ +source "https://rubygems.org" + +group :test do + gem "rake" + gem "puppet", ENV['PUPPET_VERSION'] || '~> 3.7.0' + gem "rspec", '< 3.2.0' + gem "rspec-puppet", :git => 'https://github.com/rodjek/rspec-puppet.git' + gem "puppetlabs_spec_helper" + gem "metadata-json-lint" + gem "rspec-puppet-facts" +end + +group :development do + gem "travis" + gem "travis-lint" + gem "vagrant-wrapper" + gem "puppet-blacksmith" + gem "guard-rake" +end + +group :system_tests do + gem "beaker" + gem "beaker-rspec" +end diff --git a/README.md b/README.md index 03e661c..0e8a9f2 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Puppet-LDAPquery +[![Build Status](https://travis-ci.org/xaque208/puppet-ldapquery.svg?branch=master)](https://travis-ci.org/xaque208/puppet-ldapquery) + A Puppet function to query LDAP. diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000..1778d2a --- /dev/null +++ b/Rakefile @@ -0,0 +1,56 @@ +require 'puppetlabs_spec_helper/rake_tasks' +require 'puppet/version' +require 'puppet/vendor/semantic/lib/semantic' unless Puppet.version.to_f < 3.6 +require 'puppet-lint/tasks/puppet-lint' +require 'puppet-syntax/tasks/puppet-syntax' + +# These gems aren't always present, for instance +# on Travis with --without development +begin + require 'puppet_blacksmith/rake_tasks' +rescue LoadError +end + +Rake::Task[:lint].clear + +PuppetLint.configuration.relative = true +PuppetLint.configuration.send("disable_80chars") +PuppetLint.configuration.log_format = "%{path}:%{linenumber}:%{check}:%{KIND}:%{message}" +PuppetLint.configuration.fail_on_warnings = true + +# Forsake support for Puppet 2.6.2 for the benefit of cleaner code. +# http://puppet-lint.com/checks/class_parameter_defaults/ +PuppetLint.configuration.send('disable_class_parameter_defaults') +# http://puppet-lint.com/checks/class_inherits_from_params_class/ +PuppetLint.configuration.send('disable_class_inherits_from_params_class') + +exclude_paths = [ + "bundle/**/*", + "pkg/**/*", + "vendor/**/*", + "spec/**/*", +] +PuppetLint.configuration.ignore_paths = exclude_paths +PuppetSyntax.exclude_paths = exclude_paths + +desc "Run acceptance tests" +RSpec::Core::RakeTask.new(:acceptance) do |t| + t.pattern = 'spec/acceptance' +end + +desc "Populate CONTRIBUTORS file" +task :contributors do + system("git log --format='%aN' | sort -u > CONTRIBUTORS") +end + +task :metadata do + sh "metadata-json-lint metadata.json" +end + +desc "Run syntax, lint, and spec tests." +task :test => [ + :syntax, + :lint, + :spec, + :metadata, +] diff --git a/metadata.json b/metadata.json new file mode 100644 index 0000000..6613a03 --- /dev/null +++ b/metadata.json @@ -0,0 +1,12 @@ +{ + "name": "zleslie-ldapquery", + "version": "0.0.1", + "author": "Zach Leslie", + "summary": "Query an LDAP server using Puppet.", + "license": "Apache-2.0", + "source": "https://github.com/xaque208/puppet-ldapquery", + "project_page": "https://github.com/xaque208/puppet-ldapquery", + "issues_url": "https://github.com/xaque208/puppet-ldapquery/issues", + "dependencies": [ ] +} +