Jenkins.mdwn 2.19 KB
Newer Older
1
2
3
4
5
6
7
[[!meta title="Automated ISO/IMG builds and tests on Jenkins"]]

[[!toc levels=1]]

Generating jobs
===============

8
9
10
11
12
13
14
15
16
17
18
We generate automatically a set of Jenkins jobs for branches that are
active in the Tails main Git repository.

The first brick extracts the list of active branches and output the
needed information:

 - [[!tails_gitweb config/chroot_local-includes/usr/lib/python3/dist-packages/tailslib/git.py]]
 - [[!tails_gitweb config/chroot_local-includes/usr/lib/python3/dist-packages/tailslib/jenkins.py]]

This list is parsed by the `generate_tails_iso_jobs` script run by
a cronjob and deployed by our [[!tails_gitweb_repo puppet-tails]]
19
20
`tails::jenkins::iso_jobs_generator` manifest.

21
This script output YAML files compatible with
22
[jenkins-job-builder](http://docs.openstack.org/infra/jenkins-job-builder).
23
24
25
26
27
28
It creates one `project` for each active branch, which in turn uses
several JJB `job templates` to create jobs for each branch:

 - `build_Tails_ISO_*`
 - `reproducibly_build_Tails_ISO_*`
 - `test_Tails_ISO_*`
29
30
31
32

This changes are pushed to our [[!tails_gitweb_repo jenkins-jobs]] git
repo by the cronjob, and thanks to their automatic deployment in our
`tails::jenkins::master` and `tails::gitolite::hooks::jenkins_jobs`
33
34
manifests in our [[!tails_gitweb_repo puppet-tails]] repo, these new
changes are applied to our Jenkins instance.
35
36
37
38

Passing parameters through jobs
===============================

39
40
41
42
43
44
45
46
47
48
49
50
51
52
We pass information from build job to follow-up jobs (reproducibility
testing, test suite) via two means:

 - the Parameterized Trigger plugin, whenever it's sufficient

 - the EnvInject plugin, for more complex cases:

   * In the build job, a script collects the needed information and
     writes it to a file that's saved as a build artifact.
   * This file is used by the build job itself, to setup the variables it
     needs (currently only `$NOTIFY_TO`).
   * Follow-up jobs imported this file in the workspace along with the
     build artifacts, then use an EnvInject pre-build step to load it
     and set up variables accordingly.
53
54
55
56
57
58
59
60

# Builds

See [[contribute/working_together/roles/sysadmins/automated_builds_in_Jenkins]].

# Tests

See [[contribute/working_together/roles/sysadmins/automated_tests_in_Jenkins]].