Add gate job configuration for Chef cookbooks

This commit adds the Jenkins job builders and gate
configuration for the Chef cookbooks. Only the
cookbook-openstack-common repo is changed from a
NOOP gate to the lint + unit gate at this time, as
that cookbook is the first that will be going into
the Stackforge repo.

Change-Id: I999a990f15829730495ab0891e4d38f1a5795d60
Reviewed-on: https://review.openstack.org/28640
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: Khai Do <zaro0508@gmail.com>
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Approved: Jeremy Stanley <fungi@yuggoth.org>
Tested-by: Jenkins
This commit is contained in:
Jay Pipes 2013-05-08 19:44:50 -04:00 committed by Jenkins
parent beef21e7a7
commit 05aaa0b956
5 changed files with 66 additions and 3 deletions

View File

@ -680,7 +680,7 @@ Have Zuul Monitor a Gerrit Project
=====================================
Define the required jenkins jobs for this project using the Jenkins Job
Builder. Edit openstack-infra/config:modules/openstack_project/files/jenkins_jobs/config/projects.yaml
Builder. Edit openstack-infra/config:modules/openstack_project/files/jenkins_job_builder/config/projects.yaml
and add the desired jobs. Most projects will use the python jobs template.
A minimum config::

View File

@ -0,0 +1,29 @@
- job-template:
name: 'gate-{name}-chef-unit'
node: '{node}'
triggers:
- zuul
builders:
- gerrit-git-prep
- chef-cookbook-prep
- chef-cookbook-rspec
publishers:
- console-log
- job-template:
name: 'gate-{name}-chef-lint'
node: '{node}'
triggers:
- zuul
builders:
- gerrit-git-prep
- chef-cookbook-prep
- chef-cookbook-lint
publishers:
- console-log

View File

@ -76,6 +76,29 @@
erb -x -T '-' $f | ruby -c
done
- builder:
name: chef-cookbook-prep
builders:
- shell: |
mkdir -p .cookbooks .bundle
bundle install --path=.bundle
bundle exec berks install --path=.cookbooks
export COOKBOOK=$(awk '/^name/ {print $NF}' metadata.rb |tr -d \"\')
if [ -z $COOKBOOK ]; then
echo "Cookbook name not defined in metadata.rb"
exit 1
fi
- builder:
name: chef-cookbook-lint
builders:
- shell: "bundle exec foodcritic -f any -t ~FC003 -t ~FC023 .cookbooks/$COOKBOOK"
- builder:
name: chef-cookbook-rspec
builders:
- shell: "bundle exec rspec .cookbooks/$COOKBOOK"
- builder:
name: selenium
builders:

View File

@ -879,3 +879,12 @@
jobs:
- python-jobs
- project:
name: cookbook-openstack-common
github-org: stackforge
node: quantal
jobs:
- gate-{name}-chef-lint
- gate-{name}-chef-unit

View File

@ -1668,9 +1668,11 @@ projects:
- name: stackforge/cookbook-openstack-common
check:
- gate-noop
- gate-cookbook-openstack-common-chef-lint
- gate-cookbook-openstack-common-chef-unit
gate:
- gate-noop
- gate-cookbook-openstack-common-chef-lint
- gate-cookbook-openstack-common-chef-unit
- name: stackforge/cookbook-openstack-compute
check: