From 36ce4b9fd1caf140c6d47bc81c57b69dd15628be Mon Sep 17 00:00:00 2001 From: Mark Vanderwiel Date: Tue, 5 Aug 2014 16:30:53 -0500 Subject: [PATCH] Allow compatibility with Berkshelf 2.x and 3.x openstack cookbooks currently use Berkshelf 2.x and we are moving to 3.x. Berkshelf deprecated the "berks install --path" cli in favor of "berks vendor ". While we transition all the cookbooks, need to support both versions of Berkshelf. Change-Id: I82a203fdb9b0c2ec47daefecb361d22aca306afb Addresses: blueprint update-berkshelf --- .../files/jenkins_job_builder/config/macros.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/openstack_project/files/jenkins_job_builder/config/macros.yaml b/modules/openstack_project/files/jenkins_job_builder/config/macros.yaml index 8b18a1e035..12a0775479 100644 --- a/modules/openstack_project/files/jenkins_job_builder/config/macros.yaml +++ b/modules/openstack_project/files/jenkins_job_builder/config/macros.yaml @@ -130,7 +130,12 @@ builders: - shell: | mkdir -p .cookbooks - ruby1.9.1 /usr/bin/bundle exec berks install --path=.cookbooks + grep -E .*berkshelf.*3\.\d*\.\d*.* Gemfile + if [ $? -eq 0 ]; then + ruby1.9.1 /usr/bin/bundle exec berks vendor .cookbooks + else + ruby1.9.1 /usr/bin/bundle exec berks install --path=.cookbooks + fi COOKBOOK=$(awk '/^name/ {print $NF}' metadata.rb |tr -d \"\') if [ -z $COOKBOOK ]; then echo "Cookbook name not defined in metadata.rb"