Skip to content

Commit

Permalink
Add HWRPs for installing and managing consul.
Browse files Browse the repository at this point in the history
I am channeling @someara and @reset here.

After taking a look at the new [httpd library cookbook][1] as well
as the [Mysql library cookbook][2] I think this is an excellent example
of using HWRP for defining the building blocks of a quality cookbook.

[1]: https://github.com/chef-cookbooks/httpd
[2]: https://github.com/chef-cookbooks/mysql
  • Loading branch information
johnbellone authored and John Bellone committed Jun 13, 2015
1 parent 5abab41 commit 2ec492a
Show file tree
Hide file tree
Showing 76 changed files with 868 additions and 2,378 deletions.
7 changes: 6 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
Gemfile export-ignore
Berksfile export-ignore
Vagrantfile export-ignore
Thorfile export-ignore
Guardfile export-ignore
.gitattributes export-ignore
.gitignore export-ignore
.gitmodules export-ignore
.gitattributes export-ignore
66 changes: 49 additions & 17 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,22 +1,54 @@
# Ignore docs files
_gh_pages
_site
.ruby-version
.node-version
Gemfile.lock

# Numerous always-ignore extensions
*.diff
*.err
*.orig
*.log
*.rej
*.swo
*.swp
*.zip
*.vi
*~
*#
.#*
\#*#
.*.sw[a-z]
*.un~
pkg/

# Berkshelf
.vagrant
/cookbooks
Berksfile.lock
# OS or Editor folders
.DS_Store
._*
Thumbs.db
.cache
.project
.settings
.tmproj
*.esproj
nbproject
*.sublime-project
*.sublime-workspace
.idea

# Bundler
Gemfile.lock
bin/*
.bundle/*
# Komodo
*.komodoproject
.komodotools

# grunt-html-validation
validation-status.json
validation-report.json

.kitchen/
.kitchen.local.yml
# Folders to ignore
bin
node_modules
tmp
vendor
.bundle

coverage/
# Chef specifics to ignore
.chef
.chefdk
.kitchen
.vagrant
Berksfile.lock
4 changes: 2 additions & 2 deletions .kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ provisioner:
platforms:
- name: ubuntu-14.04
- name: ubuntu-12.04
- name: centos-7.0
- name: centos-6.5
- name: centos-7.1
- name: centos-6.6

suites:
- name: default
Expand Down
1 change: 1 addition & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
--color
--require spec_helper
--default-path test/spec
51 changes: 0 additions & 51 deletions .rubocop_todo.yml

This file was deleted.

1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ language: ruby
script: bin/rspec
rvm:
- 2.1
- 2.2
branches:
only:
- master
Expand Down
8 changes: 2 additions & 6 deletions Berksfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
source 'https://supermarket.getchef.com'

source 'https://supermarket.chef.io'
cookbook 'chef-vault', git: 'https://github.com/johnbellone/chef-vault-cookbook'
metadata

group :test do
cookbook "consul_spec", path: "spec/fixtures/cookbooks/consul_spec"
end
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# 1.0.0

# 0.10
Fixes several bugs, minor enhancements and changes default version of
Consul to 0.5.2.
Expand All @@ -21,7 +23,6 @@ Consul to 0.5.2.
* Lock to Chef 11 compatible version of libarchive cookbook

# 0.9.0

* Enhancements
- Adds support for publishing to statsd URL. [@akerekes](https://github.com/akerekes)
- Adds support for Arch Linux. ([@logankoester](https://github.com/logankoester))
Expand Down
48 changes: 36 additions & 12 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,40 @@
source 'https://rubygems.org'
gem 'berkshelf'
gem 'rake'
gem 'rspec'
gem 'rubocop'
gem 'foodcritic'
gem 'tailor'
gem 'coveralls', require: false
gem 'stove'

group :test, :integration do
gem 'chef-vault', '~> 2.6'

group :lint do
gem 'rubocop'
end

group :kitchen_common do
gem 'test-kitchen', '~> 1.4'
end

group :kitchen_vagrant do
gem 'kitchen-vagrant', '~> 0.17'
end

group :kitchen_cloud do
gem 'kitchen-openstack', '~> 1.8'
end

group :unit do
gem 'berkshelf'
gem 'chefspec'
gem 'test-kitchen'
gem 'kitchen-vagrant'
end

group :integration do
gem 'serverspec'
end

group :development do
gem 'guard'
gem 'guard-kitchen'
gem 'guard-rspec'
gem 'guard-rubocop'
gem 'rake'
gem 'stove'
end

group :doc do
gem 'yard'
end
16 changes: 16 additions & 0 deletions Guardfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# More info at https://github.com/guard/guard#readme
guard 'rubocop' do
watch(%r{^attributes/.+\.rb$})
watch(%r{^providers/.+\.rb$})
watch(%r{^recipes/.+\.rb$})
watch(%r{^resources/.+\.rb$})
watch(%r{^libraries/.+\.rb$})
watch('metadata.rb')
end

guard :rspec, :cmd => 'chef exec /opt/chefdk/embedded/bin/rspec', all_on_start: false, notification: false do
watch(%r{^(recipes|libraries|providers|resources)/(.+)\.rb$}) do |m|
"test/spec/#{m[0]}/#{m[1]}_spec.rb"
end
watch('test/spec/spec_helper.rb') { 'test/spec' }
end
5 changes: 2 additions & 3 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
Copyright 2014 John Bellone <jbellone@bloomberg.net>
Copyright 2014 Bloomberg Finance L.P.
Copyright 2014, 2015 Bloomberg Finance L.P.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -11,4 +10,4 @@ Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.
Loading

0 comments on commit 2ec492a

Please sign in to comment.