From ba307ea0f56ecae0b67022778ec56ad684d2783c Mon Sep 17 00:00:00 2001 From: Jay Pipes Date: Wed, 29 May 2013 13:46:49 -0400 Subject: [PATCH] Adds Chef style checking job Adds a macro that fires off tailor to check cookbooks Chef and Ruby style. See https://review.openstack.org/#/c/30827 for some more information about the use of tailor against the Chef cookbook repositories. Marks the OpenStack Compute cookbook for gating with this new job. Change-Id: Ib5b3d6548749ddc1107a70b462f7432dde672410 Reviewed-on: https://review.openstack.org/30921 Reviewed-by: John Dewey Reviewed-by: craigtracey Reviewed-by: Clark Boylan Reviewed-by: Jeremy Stanley Approved: Jeremy Stanley Tested-by: Jenkins --- .../jenkins_job_builder/config/chef-jobs.yaml | 15 +++++++++++++++ .../files/jenkins_job_builder/config/macros.yaml | 7 +++++++ .../jenkins_job_builder/config/projects.yaml | 1 + modules/openstack_project/files/zuul/layout.yaml | 2 ++ 4 files changed, 25 insertions(+) diff --git a/modules/openstack_project/files/jenkins_job_builder/config/chef-jobs.yaml b/modules/openstack_project/files/jenkins_job_builder/config/chef-jobs.yaml index 84db2fbbb3..f119e0a77b 100644 --- a/modules/openstack_project/files/jenkins_job_builder/config/chef-jobs.yaml +++ b/modules/openstack_project/files/jenkins_job_builder/config/chef-jobs.yaml @@ -27,3 +27,18 @@ publishers: - console-log + +- job-template: + name: 'gate-{name}-chef-style' + node: '{node}' + + triggers: + - zuul + + builders: + - gerrit-git-prep + - chef-cookbook-prep + - chef-cookbook-style + + publishers: + - console-log 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 8532dc4a9c..0a96854cdf 100644 --- a/modules/openstack_project/files/jenkins_job_builder/config/macros.yaml +++ b/modules/openstack_project/files/jenkins_job_builder/config/macros.yaml @@ -89,6 +89,13 @@ exit 1 fi +- builder: + name: chef-cookbook-style + builders: + - shell: | + COOKBOOK=$(awk '/^name/ {print $NF}' metadata.rb |tr -d \"\') + ruby1.9.1 /usr/bin/bundle exec tailor + - builder: name: chef-cookbook-lint builders: diff --git a/modules/openstack_project/files/jenkins_job_builder/config/projects.yaml b/modules/openstack_project/files/jenkins_job_builder/config/projects.yaml index 3882f76c44..358b8fae88 100644 --- a/modules/openstack_project/files/jenkins_job_builder/config/projects.yaml +++ b/modules/openstack_project/files/jenkins_job_builder/config/projects.yaml @@ -964,6 +964,7 @@ jobs: - gate-{name}-chef-lint + - gate-{name}-chef-style - gate-{name}-chef-unit - project: diff --git a/modules/openstack_project/files/zuul/layout.yaml b/modules/openstack_project/files/zuul/layout.yaml index dbf7ee2d83..13980f05d1 100644 --- a/modules/openstack_project/files/zuul/layout.yaml +++ b/modules/openstack_project/files/zuul/layout.yaml @@ -1852,9 +1852,11 @@ projects: - name: stackforge/cookbook-openstack-compute check: - gate-cookbook-openstack-compute-chef-lint + - gate-cookbook-openstack-compute-chef-style - gate-cookbook-openstack-compute-chef-unit gate: - gate-cookbook-openstack-compute-chef-lint + - gate-cookbook-openstack-compute-chef-style - gate-cookbook-openstack-compute-chef-unit - name: stackforge/cookbook-openstack-dashboard