Jenkins » History » Version 10
laforge, 02/08/2020 12:16 PM
no more freebsd
1 | 6 | laforge | {{>toc}} |
---|---|---|---|
2 | 1 | ||
3 | 4 | laforge | h1. Continuous Integration with Jenkins |
4 | 1 | ||
5 | 4 | laforge | h2. What |
6 | 1 | ||
7 | 6 | laforge | The Osmocom Cellular Infrastructure software stack has grown to a size where it make sense to somehow track the state after each commit. The "Jenkins Software":https://jenkins.io/ allows us to do this. The installation can be found at http://jenkins.osmocom.org/jenkins and all of Osmocom is tracked there. The goal is to have all projects/repositories of the osmocom umbrella tracked there. |
8 | 1 | ||
9 | 8 | laforge | We are happy if people donate CPU time to be used as additional nodes (Build Slaves) to execute the compile jobs. Please contact laforge@gnumonks.org if you want to donate some. |
10 | 5 | laforge | |
11 | 4 | laforge | h2. How |
12 | 3 | ||
13 | 10 | laforge | We are using Jenkins in a Docker container. Currently there are several build slaves, primarily a peair of Debian GNU/Linux 8 and 9 LXC containers on amd64 on each of the physical build hosts. |
14 | 1 | ||
15 | See also [[osmocom-servers:Jenkins_Node_Setup]] |
||
16 | |||
17 | 8 | laforge | h3. Jenkins Job Builder |
18 | |||
19 | 9 | laforge | Initially we used manually-configured jenkins jobs using the Jenkins Web UI. With a lot of projects, it's easy to introduce inconsistency and becomes difficult to maintain. Instead, we step by step migrated to using "Jenkins Job Builder":https://docs.openstack.org/infra/jenkins-job-builder/ which allows us to describe build jobs in YAML syntax. You can find our job descriptions at http://git.osmocom.org/osmo-ci/tree/jobs - and as always, contributions are welcome. |
20 | 8 | laforge | |
21 | 6 | laforge | h3. Custom Build Helper Scripts |
22 | 1 | ||
23 | 6 | laforge | If you look into the jenkins job configuration of the individual jobs, you will notice that they use a custom helper script that is part of each Osmocom projects' git repository: @contrib/jenkins.sh@ (for an example, see http://git.osmocom.org/libosmo-netif/tree/contrib/jenkins.sh) |
24 | 5 | laforge | |
25 | 6 | laforge | This @contrib/jenkins.sh@ expects that some common helper scripts from http://git.osmocom.org/osmo-ci are in your PATH at the time of execution. The common helper scripts (such as @osmo-deps.sh@ or @osmo-build-dep.sh@). Those helpers perform tasks similar to all osmocom projects, i.e. clone/update a dependency in the workspace of a build node. The script will try to @git-clone@, @git-fetch@, @git-reset --hard@ the dependency. |
26 | 3 | ||
27 | 6 | laforge | h4. Building code like jenkins build slave would do it |
28 | |||
29 | During development, it sometimes is useful to build the code just like it is built on the jenkins build slave. |
||
30 | |||
31 | 5 | laforge | If you would like to do that, you should |
32 | 3 | # @git clone git://git.osmocom.org/osmo-ci@ |
|
33 | 1 | # set your shell @PATH@ to include the @osmo-ci/scripts@ directory |
|
34 | # set the @MAKE@ environment variable to your make command (@make@ or @gmake@) |
||
35 | # go to the root directory of the respective project git repo (e.g. libosmo-netif) |
||
36 | 5 | laforge | # execute @./contrib/jenkins.sh@ |