This repository contains the Jenkins
Config-as-Code (JCasC) YAML needed to
create a pre-configured Jenkins Docker container, and the job-dsl Groovy code
for generating the KernelCI jobs. There are some sample docker-compose
environment files with variables used for production, staging, and development.
This Jenkins project is used to run a full KernelCI pipeline automatically. It
needs at least a
kernelci-backend instance to
be able to publish kernel builds, and typically at least one
LAVA lab instance to run tests. Installing
those things is not covered here, please refer to their corresponding
documentation.
- Copy the
envfile to.envand edit it with your own settings - Add any extra plugins (
github-auth,openstacketc) to theplugins-extra.txtfile and they will be included in the build. - Add your LAVA lab credentials in
config/secrets.yaml - Any CasC YAML files that exist in the
configdirectory will also be loaded, so you can create your own. - Jenkins nodes should be configured in
config/nodes.yaml(you will have to create this). - Add any extra parameters you've used in your config to
.env. - Edit the
ADMIN_PASSWORDin.env.
Then the container can be used using regular docker-compose commands. Here
are a few examples:
-
docker-compose up --build- action: start the container in the foreground
- notes: useful when testing the configuration
-
docker-compose up --build -d- action: start the container in the background
- notes: typical usage to keep the service running
-
docker-compose stop- action: stop the container
- notes: useful when editing the configuration
-
docker-compose down- action: destroy the container
- notes: WARNING: any jobs data or manual Jenkins configuration will be lost
-
docker-compose logs -f jenkins- action: read the Jenkins logs
- notes: useful for monitoring activity
-
docker-compose exec jenkins bash- action: start an interactive shell in the running container
- notes: useful to debug problems by accessing files directly
Initially a single job is created, this is the DSL seed job which can be used
to create all the other ones defined in jobs.groovy. Open the
Jenkins web UI and start this job to see the other ones listed below appear on
the Jenkins instance.
All the automated jobs on kernelci.org are run in Jenkins. Some legacy scripts
are still being used in "freestyle" projects but they are gradually being
replaced with Pipeline jobs. Each Pipeline job has a .jpl file located in
the jenkins directory:
jenkins/monitor.jplto monitor kernel branches and detect new revisionsjenkins/build-trigger.jplto trigger all the builds for a kernel revisionjenkins/build.jplto build a single kerneljenkins/test-runner.jplto run tests for a single kernel buildjenkins/bisect.jplto run automated test bisectionsjenkins/rootfs-trigger.jplto trigger a series of rootfs image buildsjenkins/rootfs-builder.jplto build a single rootfs image
In addition to the job files, there are also some common library files located
in the
src/org/kernelci
directory.