~ltrager/maas/maas-images-centos

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
This is the configuration for all the MAAS CI jobs running
on MAAS' CI (see http://goo.gl/Dxz6eW for details).

Installation and configuration
==============================

Install the jenkins-job-builder package.

NOTE: If you are on Trusty, the packaged version doesn't work with the
Jenkins instance we have, so, in that case, we have to install it from
source):

  $ git clone https://github.com/openstack-infra/jenkins-job-builder/
  $ cd jenkins-job-builder
  $ sudo python setup.py install

Get your Jenkins API token (see http://goo.gl/Dxz6eW).

Create a configuration file with your credentials in it:

  $ cat ~/.config/jenkins-job-builder/jenkins_job.ini
  [jenkins]
  user=<username>
  password=<password>
  url=http://d-jenkins.ubuntu-ci:8080

Job definition generation
=========================

Once you've made changes to the CI config, you can generate the
job definition using:

  $ /usr/local/bin/jenkins-jobs --conf ~/.config/jenkins-job-builder/jenkins_job.ini test
    jenkins/jobs/ -o /tmp/jobs-definitions/

If you want to compare this with what's actually running on the Jenkins
instance, you need to compare this output with what's on the Jenkins server.


Job definition deployment
=========================

Once you're happy with the changes, you can deploy your changes to Jenkins:

  $ /usr/local/bin/jenkins-jobs --conf <path-to-conf> update <path-to-jobs-definition>

Here is a real world example (assuming ~/work/maas-ci-config contains
a branch with CI job definitions):

  $ /usr/local/bin/jenkins-jobs --conf ~/.config/jenkins-job-builder/jenkins_job.ini
    update ~/work/maas-ci-config/jenkins/jobs/