Merge "Set ruby and gem default to 1.9.1 for cookbook jobs on precise"

This commit is contained in:
Jenkins 2014-09-08 20:30:23 +00:00 committed by Gerrit Code Review
commit bba12cb11a
2 changed files with 26 additions and 11 deletions

View File

@ -9,6 +9,7 @@
builders: builders:
- gerrit-git-prep - gerrit-git-prep
- ruby-191-prep
- chef-bundler-prep - chef-bundler-prep
- revoke-sudo - revoke-sudo
- chef-berkshelf-prep - chef-berkshelf-prep
@ -28,6 +29,7 @@
builders: builders:
- gerrit-git-prep - gerrit-git-prep
- ruby-191-prep
- chef-bundler-prep - chef-bundler-prep
- revoke-sudo - revoke-sudo
- chef-berkshelf-prep - chef-berkshelf-prep
@ -47,6 +49,7 @@
builders: builders:
- gerrit-git-prep - gerrit-git-prep
- ruby-191-prep
- chef-bundler-prep - chef-bundler-prep
- revoke-sudo - revoke-sudo
- chef-berkshelf-prep - chef-berkshelf-prep
@ -61,13 +64,14 @@
builders: builders:
- gerrit-git-prep - gerrit-git-prep
- ruby-191-prep
- chef-bundler-prep - chef-bundler-prep
- revoke-sudo - revoke-sudo
- chef-berkshelf-prep - chef-berkshelf-prep
- shell: | - shell: |
#!/bin/bash -xe #!/bin/bash -xe
# Validates roles # Validates roles
ruby1.9.1 `which bundle` exec spiceweasel infrastructure.yml --debug bundle exec spiceweasel infrastructure.yml --debug
publishers: publishers:
- console-log - console-log

View File

@ -123,6 +123,17 @@
builders: builders:
- shell: "./test.sh" - shell: "./test.sh"
- builder:
name: ruby-191-prep
builders:
- shell: |
#!/bin/bash -x
sudo update-alternatives --install /usr/bin/ruby ruby /usr/bin/ruby1.9.1 20
sudo update-alternatives --set ruby /usr/bin/ruby1.9.1
sudo update-alternatives --install /usr/bin/gem gem /usr/bin/gem1.9.1 10
sudo update-alternatives --set gem /usr/bin/gem1.9.1
sudo gem update --no-rdoc --no-ri
- builder: - builder:
name: chef-bundler-prep name: chef-bundler-prep
builders: builders:
@ -133,9 +144,9 @@
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
# For Berkshelf 3.x use the system gecode 3.x libraries # For Berkshelf 3.x use the system gecode 3.x libraries
sudo apt-get install -y libgecode-dev sudo apt-get install -y libgecode-dev
USE_SYSTEM_GECODE=1 ruby1.9.1 `which bundle` install --path=.bundle --jobs 1 --retry 3 --verbose USE_SYSTEM_GECODE=1 bundle install --path=.bundle --jobs 1 --retry 3 --verbose
else else
ruby1.9.1 `which bundle` install --path=.bundle --jobs 1 --retry 3 --verbose bundle install --path=.bundle --jobs 1 --retry 3 --verbose
fi fi
- builder: - builder:
@ -145,10 +156,10 @@
#!/bin/bash -x #!/bin/bash -x
grep -E .*berkshelf.*3\.\d*\.\d*.* Gemfile grep -E .*berkshelf.*3\.\d*\.\d*.* Gemfile
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
ruby1.9.1 `which bundle` exec berks vendor .cookbooks bundle exec berks vendor .cookbooks
else else
mkdir -p .cookbooks mkdir -p .cookbooks
ruby1.9.1 `which bundle` exec berks install --path=.cookbooks bundle exec berks install --path=.cookbooks
fi fi
COOKBOOK=$(awk '/^name/ {print $NF}' metadata.rb |tr -d \"\') COOKBOOK=$(awk '/^name/ {print $NF}' metadata.rb |tr -d \"\')
if [ -z $COOKBOOK ]; then if [ -z $COOKBOOK ]; then
@ -162,9 +173,9 @@
- shell: | - shell: |
#!/bin/bash -x #!/bin/bash -x
if grep rubocop: Strainerfile; then if grep rubocop: Strainerfile; then
ruby1.9.1 `which bundle` exec strainer test --cookbooks-path=.cookbooks --only=rubocop bundle exec strainer test --cookbooks-path=.cookbooks --only=rubocop
else else
ruby1.9.1 `which bundle` exec rubocop bundle exec rubocop
fi fi
- builder: - builder:
@ -173,9 +184,9 @@
- shell: | - shell: |
#!/bin/bash -x #!/bin/bash -x
if grep foodcritic: Strainerfile; then if grep foodcritic: Strainerfile; then
ruby1.9.1 `which bundle` exec strainer test --cookbooks-path=.cookbooks --only=foodcritic bundle exec strainer test --cookbooks-path=.cookbooks --only=foodcritic
else else
ruby1.9.1 `which bundle` exec foodcritic -f any -t ~FC003 -t ~FC023 . bundle exec foodcritic -f any -t ~FC003 -t ~FC023 .
fi fi
- builder: - builder:
@ -185,9 +196,9 @@
#!/bin/bash -x #!/bin/bash -x
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 `which bundle` exec strainer test --cookbooks-path=.cookbooks --only=chefspec bundle exec strainer test --cookbooks-path=.cookbooks --only=chefspec
else else
ruby1.9.1 `which bundle` exec rspec .cookbooks/$COOKBOOK/spec bundle exec rspec .cookbooks/$COOKBOOK/spec
fi fi
- builder: - builder: