Merge "Fix Chef cookbook-related strainer issue"

This commit is contained in:
Jenkins 2014-06-04 14:49:42 +00:00 committed by Gerrit Code Review
commit b5c62380f8
2 changed files with 6 additions and 5 deletions

View File

@ -20,6 +20,7 @@
- revoke-sudo - revoke-sudo
- gerrit-git-prep - gerrit-git-prep
- chef-bundler-prep - chef-bundler-prep
- chef-berkshelf-prep
- chef-cookbook-foodcritic - chef-cookbook-foodcritic
publishers: publishers:
@ -33,6 +34,7 @@
- revoke-sudo - revoke-sudo
- gerrit-git-prep - gerrit-git-prep
- chef-bundler-prep - chef-bundler-prep
- chef-berkshelf-prep
- chef-cookbook-rubocop - chef-cookbook-rubocop
publishers: publishers:

View File

@ -140,11 +140,10 @@
name: chef-cookbook-rubocop name: chef-cookbook-rubocop
builders: builders:
- shell: | - shell: |
COOKBOOK=$(awk '/^name/ {print $NF}' metadata.rb |tr -d \"\')
if grep rubocop: Strainerfile; then if grep rubocop: Strainerfile; then
ruby1.9.1 /usr/bin/bundle exec strainer test -o rubocop ruby1.9.1 /usr/bin/bundle exec strainer test --cookbooks-path=.cookbooks --only=rubocop
else else
ruby1.9.1 /usr/bin/bundle exec ruby1.9.1 /usr/bin/bundle exec rubocop ruby1.9.1 /usr/bin/bundle exec rubocop
fi fi
- builder: - builder:
@ -152,7 +151,7 @@
builders: builders:
- shell: | - shell: |
if grep foodcritic: Strainerfile; then if grep foodcritic: Strainerfile; then
ruby1.9.1 /usr/bin/bundle exec strainer test -o foodcritic ruby1.9.1 /usr/bin/bundle exec strainer test --cookbooks-path=.cookbooks --only=foodcritic
else else
ruby1.9.1 /usr/bin/bundle exec foodcritic -f any -t ~FC003 -t ~FC023 . ruby1.9.1 /usr/bin/bundle exec foodcritic -f any -t ~FC003 -t ~FC023 .
fi fi
@ -163,7 +162,7 @@
- shell: | - shell: |
COOKBOOK=$(awk '/^name/ {print $NF}' metadata.rb |tr -d \"\') COOKBOOK=$(awk '/^name/ {print $NF}' metadata.rb |tr -d \"\')
if grep chefspec: Strainerfile; then if grep chefspec: Strainerfile; then
ruby1.9.1 /usr/bin/bundle exec strainer test -o chefspec ruby1.9.1 /usr/bin/bundle exec strainer test --cookbooks-path=.cookbooks --only=chefspec
else else
ruby1.9.1 /usr/bin/bundle exec rspec .cookbooks/$COOKBOOK/spec ruby1.9.1 /usr/bin/bundle exec rspec .cookbooks/$COOKBOOK/spec
fi fi