Installing Jenkins Job Builder on Centos 7

This post covers installing Jenkins Job Builder on CentOS 7. This step-by-step guide covers the installation process from a minimal CentOS 7 installation through a functional jenkins job builder installation.

Step #1: Update system packages

sudo yum -y update

Step #2: Add additional repositories

sudo rpm -iUvh http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm

Step #3: Install python prerequisites

sudo yum install -y python-setuptools python-dev libyaml-dev git curl python-pip python-yaml

Step #4: Install jenkins job builder

sudo pip install pbr PyYAML python-jenkins jenkins-job-builder

Configuration File

Jenkins job builder requires a configuration file that holds settings for the job builder, jenkins, hipchat, and stash integrations.


[job_builder]
ignore_cache=True
keep_descriptions=False
include_path=.:scripts:~/git/
recursive=False
exclude=.*:manual:./development
allow_duplicates=False

[jenkins]
user=jenkins
password=1234567890abcdef1234567890abcdef
url=https://jenkins.example.com
query_plugins_info=False
##### This is deprecated, use job_builder section instead
#ignore_cache=True

[hipchat]
authtoken=dummy

[stash]
username=user
password=pass

Example Job

The following section covers a few of the basic jenkins-jobs commands for tasks such as testing and updating the jenkins jobs.

Test example job

jenkins-jobs --conf jenkins_jobs.ini test example.yaml

Create/Update test job

jenkins-jobs --conf jenkins_jobs.ini update example.yaml

References:

Jenkins Job Builder: http://docs.openstack.org/infra/jenkins-job-builder/index.html

Subscribe to