diff --git a/.gitignore b/.gitignore index e9d0128e..f7fa15f9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,3 @@ -Cheffile.lock .bundle -.cache -.rvmrc -*.swp -/cookbooks -/tmp +.cookbooks/ +Berkfile.lock diff --git a/Berksfile b/Berksfile new file mode 100644 index 00000000..850a120d --- /dev/null +++ b/Berksfile @@ -0,0 +1 @@ +metadata diff --git a/Berksfile.lock b/Berksfile.lock new file mode 100644 index 00000000..4e69e1f0 --- /dev/null +++ b/Berksfile.lock @@ -0,0 +1,9 @@ +cookbook 'openstack-common', :path => '/home/jdewey/git/cookbook-openstack-common' +cookbook 'apt', :locked_version => '1.8.0' +cookbook 'database', :locked_version => '1.3.10' +cookbook 'mysql', :locked_version => '2.1.0' +cookbook 'openssl', :locked_version => '1.0.0' +cookbook 'build-essential', :locked_version => '1.3.2' +cookbook 'postgresql', :locked_version => '2.1.0' +cookbook 'aws', :locked_version => '0.100.6' +cookbook 'xfs', :locked_version => '1.1.0' \ No newline at end of file diff --git a/Cheffile b/Cheffile deleted file mode 100644 index 3acda9b6..00000000 --- a/Cheffile +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env ruby - -site "http://community.opscode.com/api/v1" - -cookbook "database" diff --git a/Gemfile b/Gemfile index c0b83dc3..36a4481a 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,5 @@ source :rubygems +gem "berkshelf", "~> 1.0.4" gem "chefspec", "~> 0.9.0" -gem "librarian", "~> 0.0.24" gem "foodcritic", "~> 1.6.1" -gem "hashie", "~> 1.2.0" diff --git a/Gemfile.lock b/Gemfile.lock index b66080f4..7ee71f11 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,10 +1,32 @@ GEM remote: http://rubygems.org/ specs: + activemodel (3.2.11) + activesupport (= 3.2.11) + builder (~> 3.0.0) + activesupport (3.2.11) + i18n (~> 0.6) + multi_json (~> 1.0) + addressable (2.3.2) archive-tar-minitar (0.5.2) - builder (3.1.4) + berkshelf (1.0.4) + activesupport + chef (>= 10.16.2) + chozo (>= 0.2.3) + hashie + minitar + multi_json (>= 1.3.0) + ridley (>= 0.4.1) + solve (>= 0.4.0.rc1) + thor (~> 0.16.0) + vagrant (~> 1.0.5) + yajl-ruby + builder (3.0.4) bunny (0.7.9) - chef (10.16.2) + celluloid (0.12.4) + facter (>= 1.6.12) + timers (>= 1.0.0) + chef (10.18.2) bunny (>= 0.6.0, < 0.8.0) erubis highline (>= 1.6.9) @@ -14,7 +36,7 @@ GEM mixlib-config (>= 1.1.2) mixlib-log (>= 1.3.0) mixlib-shellout - moneta + moneta (< 0.7.0) net-ssh (~> 2.2.2) net-ssh-multi (~> 1.1.0) ohai (>= 0.6.0) @@ -27,11 +49,21 @@ GEM erubis minitest-chef-handler (~> 0.6.0) rspec (~> 2.11.0) - ci_reporter (1.7.3) + childprocess (0.3.7) + ffi (~> 1.0, >= 1.0.6) + chozo (0.4.2) + activesupport (>= 3.2.0) + hashie + multi_json (>= 1.3.0) + ci_reporter (1.8.4) builder (>= 2.1.2) coderay (1.0.8) diff-lcs (1.1.3) erubis (2.7.0) + facter (1.6.17) + faraday (0.8.4) + multipart-post (~> 1.1) + ffi (1.3.1) foodcritic (1.6.1) erubis gherkin (~> 2.11.1) @@ -43,30 +75,33 @@ GEM yajl-ruby (~> 1.1.0) gherkin (2.11.5) json (>= 1.4.6) - gist (3.1.0) + gist (3.1.1) hashie (1.2.0) highline (1.6.15) + i18n (0.6.1) ipaddress (0.8.0) - json (1.6.1) - librarian (0.0.25) - archive-tar-minitar (>= 0.5.2) - chef (>= 0.10) - highline - thor (~> 0.15) + json (1.5.4) + log4r (1.1.10) method_source (0.7.1) mime-types (1.19) - minitest (4.2.0) - minitest-chef-handler (0.6.3) + minitar (0.5.4) + minitest (4.5.0) + minitest-chef-handler (0.6.5) chef ci_reporter minitest mixlib-authentication (1.3.0) mixlib-log - mixlib-cli (1.2.2) + mixlib-cli (1.3.0) mixlib-config (1.1.2) mixlib-log (1.4.1) mixlib-shellout (1.1.0) moneta (0.6.0) + multi_json (1.5.0) + multipart-post (1.1.5) + net-http-persistent (2.8) + net-scp (1.0.4) + net-ssh (>= 1.99.1) net-ssh (2.2.2) net-ssh-gateway (1.1.0) net-ssh (>= 1.99.1) @@ -74,11 +109,12 @@ GEM net-ssh (>= 2.1.4) net-ssh-gateway (>= 0.99.0) nokogiri (1.5.0) - ohai (6.14.0) + ohai (6.16.0) ipaddress mixlib-cli mixlib-config mixlib-log + mixlib-shellout systemu yajl-ruby polyglot (0.3.3) @@ -89,6 +125,20 @@ GEM rak (1.4) rest-client (1.6.7) mime-types (>= 1.16) + ridley (0.6.3) + activemodel (>= 3.2.0) + activesupport (>= 3.2.0) + addressable + celluloid + chozo (>= 0.2.2) + erubis + faraday + json (>= 1.5.0) + mixlib-authentication + mixlib-log + multi_json (>= 1.0.4) + net-http-persistent (>= 2.8) + net-ssh rspec (2.11.0) rspec-core (~> 2.11.0) rspec-expectations (~> 2.11.0) @@ -98,19 +148,30 @@ GEM diff-lcs (~> 1.1.3) rspec-mocks (2.11.3) slop (2.4.4) + solve (0.4.1) + json systemu (2.5.2) thor (0.16.0) + timers (1.1.0) treetop (1.4.12) polyglot polyglot (>= 0.3.1) uuidtools (2.1.3) + vagrant (1.0.6) + archive-tar-minitar (= 0.5.2) + childprocess (~> 0.3.1) + erubis (~> 2.7.0) + i18n (~> 0.6.0) + json (~> 1.5.1) + log4r (~> 1.1.9) + net-scp (~> 1.0.4) + net-ssh (~> 2.2.2) yajl-ruby (1.1.0) PLATFORMS ruby DEPENDENCIES + berkshelf (~> 1.0.4) chefspec (~> 0.9.0) foodcritic (~> 1.6.1) - hashie (~> 1.2.0) - librarian (~> 0.0.24) diff --git a/README.md b/README.md index 0eb83761..d41c390d 100644 --- a/README.md +++ b/README.md @@ -143,14 +143,11 @@ in your recipe. Testing ===== -This cookbook is using [ChefSpec](https://github.com/acrmp/chefspec) for testing. +This cookbook is using [ChefSpec](https://github.com/acrmp/chefspec) for +testing. Should run the following before commiting. It will run your tests, +and check for lint errors. - $ cd $repo - $ bundle - $ librarian-chef install - $ ln -s ../ cookbooks/$short_repo_name # doesn't contain "cookbook-" - $ foodcritic cookbooks/$short_repo_name - $ bundle exec rspec cookbooks/$short_repo_name + % ./run_tests.bash License and Author ================== diff --git a/run_tests.bash b/run_tests.bash new file mode 100755 index 00000000..cddfd4ef --- /dev/null +++ b/run_tests.bash @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +# A script to run tests locally before committing. + +set -e + +COOKBOOK=$(awk '/^name/ {print $NF}' metadata.rb |tr -d \"\') + +bundle install +bundle exec berks install --path .cookbooks +bundle exec foodcritic -f any -t ~FC003 -t ~FC023 .cookbooks/${COOKBOOK} +bundle exec rspec .cookbooks/${COOKBOOK}