diff options
author | James Shubin <james@shubin.ca> | 2014-10-10 14:49:44 -0400 |
---|---|---|
committer | James Shubin <james@shubin.ca> | 2014-10-10 14:49:44 -0400 |
commit | f24cca2ac8d138aae71c019a9bf6f311395f562d (patch) | |
tree | 0f4512fdba461839588626d792be0ee08bb7d06e | |
parent | 6c962083d8b100dcaeb6f11dbe61e6071f3d13f0 (diff) | |
download | puppet-gluster-f24cca2ac8d138aae71c019a9bf6f311395f562d.tar.gz puppet-gluster-f24cca2ac8d138aae71c019a9bf6f311395f562d.tar.xz puppet-gluster-f24cca2ac8d138aae71c019a9bf6f311395f562d.zip |
Infra update for puppet-gluster...
w00t, c-i, and automatic pushing.
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | .travis.yml | 16 | ||||
-rw-r--r-- | Gemfile | 11 | ||||
-rw-r--r-- | Makefile | 13 | ||||
-rw-r--r-- | Modulefile | 12 | ||||
-rw-r--r-- | README | 34 | ||||
-rw-r--r--[l---------] | README.md | 45 | ||||
-rw-r--r-- | Rakefile | 47 | ||||
-rw-r--r-- | VERSION | 1 | ||||
-rw-r--r-- | metadata.json | 15 | ||||
-rw-r--r-- | spec/spec_helper.rb | 18 |
11 files changed, 164 insertions, 50 deletions
@@ -4,4 +4,4 @@ pkg/ docs/ hacking/ rpmbuild/ -screencasts/ +.pmtignore diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..354f4ef --- /dev/null +++ b/.travis.yml @@ -0,0 +1,16 @@ +language: ruby +rvm: 1.8.7 +notifications: + email: + - travis-ci@shubin.ca +# TODO: do a full rake test once warnings are all gone! +#script: 'bundle exec rake test' +script: 'bundle exec rake syntax' +env: +# - PUPPET_VERSION=2.7.26 + - PUPPET_VERSION=3.0.2 + - PUPPET_VERSION=3.1.1 + - PUPPET_VERSION=3.2.4 + - PUPPET_VERSION=3.3.2 + - PUPPET_VERSION=3.4.3 + @@ -0,0 +1,11 @@ +source 'https://rubygems.org' + +puppet_version = ENV.key?('PUPPET_VERSION') ? "= #{ENV['PUPPET_VERSION']}" : ['>= 3.0'] + +gem 'rake' +gem 'puppet', puppet_version +gem 'puppet-lint' # style things, eg: tabs vs. spaces +gem 'rspec-puppet', :git => 'https://github.com/rodjek/rspec-puppet.git' +gem 'puppet-syntax' # syntax checking +gem 'puppetlabs_spec_helper' + @@ -15,11 +15,11 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. -.PHONY: all docs rpm srpm spec tar upload upload-sources upload-srpms upload-rpms +.PHONY: all push docs test rpm srpm spec tar upload upload-sources upload-srpms upload-rpms .SILENT: # version of the program -VERSION := $(shell cat VERSION) +VERSION := $(shell gjs -c "print(`cat metadata.json`['version'])") RELEASE = 1 SPEC = rpmbuild/SPECS/puppet-gluster.spec SOURCE = rpmbuild/SOURCES/puppet-gluster-$(VERSION).tar.bz2 @@ -30,11 +30,20 @@ REMOTE_PATH = 'purpleidea/puppet-gluster' all: docs rpm +push: + # use blacksmith to push module to forge + git checkout master && rake module:push + docs: puppet-gluster-documentation.pdf puppet-gluster-documentation.pdf: DOCUMENTATION.md pandoc DOCUMENTATION.md -o 'puppet-gluster-documentation.pdf' +test: + # TODO: avoid exiting with non-zero when there are only warnings? + #rake syntax + rake test + # # aliases # diff --git a/Modulefile b/Modulefile deleted file mode 100644 index 2eaa0ab..0000000 --- a/Modulefile +++ /dev/null @@ -1,12 +0,0 @@ -name 'purpleidea-gluster' -author 'James Shubin' -license 'GNU Affero General Public License, Version 3.0+' -summary 'GlusterFS module by James' -description 'A Puppet module for GlusterFS' -project_page 'https://github.com/purpleidea/puppet-gluster/' -source 'https://ttboj.wordpress.com/' -version '0.0.4' - -## Add dependencies, if any: -# dependency 'username/name', '>= 1.2.0' - @@ -1,34 +1,2 @@ -This is puppet-gluster a puppet module for gluster. - -Please read the INSTALL file for instructions on getting this installed. -Look in the examples/ folder for usage. If none exist, please contribute one! -This code may be a work in progress. The interfaces may change without notice. -Patches are welcome, but please be patient. They are best received by email. -Please ping me if you have big changes in mind, before you write a giant patch. - -Module specific notes: -* This is _the_ puppet module for gluster. Accept no imitations! -* All the participating nodes, need to have an identical puppet-gluster config. -* Using gluster::simple is probably the best way to try this out. -* This is easily deployed with vagrant. See the vagrant/ directory! -* You can use less of the available resources, if you only want to manage some. -* You can get CentOS and RHEL rpms from: - * http://download.gluster.org/pub/gluster/glusterfs/LATEST/CentOS/ or: - * http://repos.fedorapeople.org/repos/kkeithle/glusterfs/epel-6/x86_64/ -* Documentation is now available! Please report grammar and spelling bugs. - -Dependencies: -* puppetlabs-stdlib (required) -* puppet-module-data (optional, puppet >= 3.0.0) -* my puppet-common module (optional) -* my puppet-shorewall module (optional) -* my puppet-keepalived module (optional) -* my puppet-puppet module (optional) -* my puppet-yum module (optional) -* gluster packages (see above notes) -* pandoc (for building a pdf of the documentation) - - -Happy hacking, -James Shubin <james@shubin.ca>, https://ttboj.wordpress.com/ +Please see README.md diff --git a/README.md b/README.md index fc84f4f..b4a0e3c 120000..100644 --- a/README.md +++ b/README.md @@ -1 +1,44 @@ -DOCUMENTATION.md
\ No newline at end of file +# *puppet-gluster*: a puppet module for GlusterFS + +[![Build Status](https://secure.travis-ci.org/purpleidea/puppet-gluster.png)](http://travis-ci.org/purpleidea/puppet-gluster) + +## Documentation: +Please see: [DOCUMENTATION.md](DOCUMENTATION.md) or [puppet-gluster-documentation.pdf](puppet-gluster-documentation.pdf). + +## Installation: +Please read the [INSTALL](INSTALL) file for instructions on getting this installed. + +## Examples: +Please look in the [examples/](examples/) folder for usage. If none exist, please contribute one! + +## Module specific notes: +* This is _the_ puppet module for gluster. Accept no imitations! +* All the participating nodes, need to have an identical puppet-gluster config. +* Using gluster::simple is probably the best way to try this out. +* This is easily deployed with vagrant. See the [vagrant/](vagrant/) directory! +* You can use less of the available resources, if you only want to manage some. +* You can get CentOS and RHEL rpms from: +** http://download.gluster.org/pub/gluster/glusterfs/LATEST/CentOS/ or: +** http://repos.fedorapeople.org/repos/kkeithle/glusterfs/epel-6/x86_64/ +* Documentation is now available! Please report grammar and spelling bugs. + +## Dependencies: +* [puppetlabs-stdlib](https://github.com/puppetlabs/puppetlabs-stdlib) (required) +* [puppet-module-data](https://github.com/ripienaar/puppet-module-data/) (optional, puppet >= 3.0.0) +* my [puppet-common](https://github.com/purpleidea/puppet-common) module (optional) +* my [puppet-shorewall](https://github.com/purpleidea/puppet-shorewall) module (optional) +* my [puppet-keepalived](https://github.com/purpleidea/puppet-keepalived) module (optional) +* my [puppet-puppet](https://github.com/purpleidea/puppet-puppet) module (optional) +* my [puppet-yum](https://github.com/purpleidea/puppet-yum) module (optional) +* gluster packages (see above notes) +* pandoc (for building a pdf of the documentation) + +## Patches: +This code may be a work in progress. The interfaces may change without notice. +Patches are welcome, but please be patient. They are best received by email. +Please ping me if you have big changes in mind, before you write a giant patch. + +## + +Happy hacking! + diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000..68a36ca --- /dev/null +++ b/Rakefile @@ -0,0 +1,47 @@ +require 'puppetlabs_spec_helper/rake_tasks' +require 'puppet-lint/tasks/puppet-lint' +require 'puppet-syntax/tasks/puppet-syntax' + +# These two gems aren't always present, for instance +# on Travis with --without development +begin + require 'puppet_blacksmith/rake_tasks' +rescue LoadError +end + +PuppetLint.configuration.relative = true +PuppetLint.configuration.send('disable_2sp_soft_tabs') +PuppetLint.configuration.send('disable_hard_tabs') +PuppetLint.configuration.send('disable_arrow_alignment') +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 = [ + "pkg/**/*", + "vendor/**/*", + "spec/**/*", + "tmp/**/*", + "vagrant/**/*", # TODO: remove this, once we update vagrant/ to puppet4 +] +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 'Run syntax, lint, and spec tests.' +task :test => [ + :syntax, + :lint, + :spec, +] + diff --git a/VERSION b/VERSION deleted file mode 100644 index 81340c7..0000000 --- a/VERSION +++ /dev/null @@ -1 +0,0 @@ -0.0.4 diff --git a/metadata.json b/metadata.json new file mode 100644 index 0000000..f19b743 --- /dev/null +++ b/metadata.json @@ -0,0 +1,15 @@ +{ + "name": "purpleidea-gluster", + "version": "0.0.5", + "author": "James Shubin", + "summary": "A Puppet module for GlusterFS", + "license": "GNU Affero General Public License, Version 3.0+", + "source": "https://github.com/purpleidea/puppet-gluster/", + "project_page": "https://github.com/purpleidea/puppet-gluster/", + "issues_url": null, + "description": "UNKNOWN", + "dependencies": [ + { "name": "puppetlabs/stdlib", "version_requirement": ">= 4.0.0" } + ] +} + diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb new file mode 100644 index 0000000..b51de3a --- /dev/null +++ b/spec/spec_helper.rb @@ -0,0 +1,18 @@ +dir = File.expand_path(File.dirname(__FILE__)) +$LOAD_PATH.unshift File.join(dir, 'lib') + +require 'mocha' +require 'puppet' +require 'rspec' +require 'spec/autorun' + +Spec::Runner.configure do |config| + config.mock_with :mocha +end + +# We need this because the RAL uses 'should' as a method. This +# allows us the same behaviour but with a different method name. +class Object + alias :must :should +end + |