Skip to content

Important settings for a Jenkins job

Florian Tschopp edited this page Dec 6, 2017 · 7 revisions

General requirements for any Job!

  • Turn on the SSH-Agent if you don't bind (e.g. via labels) it to the master node. (see ssh-agent)

Optional requirements

  • If the job needs a roscore running there are two options:

  • --roscore or -r argument for run_build.sh (see roscore)

  • use the rostest package (see rostest documentation)

  • If the job requires additional system dependencies or setup steps, a prepare script can be used. For this, the --prepare-system-script or -x argument for run_build.sh needs to be set. See prepare-script. The script can run sudo apt-get install, other commands requiring sudo permissions are not possible.

Binding a job to labels or nodes

If a Job is bound to a label or a node then Jenkins builds the job only on the specified node or a node (master or slave) with a matching label (see label). By binding a job to a certain label, a job can be restricted to certain operating systems / build environment.

The following labels are supported:

  • ubuntu-trusty (with ROS indigo)
  • ubuntu-xenial (with ROS kinetic)
  • ubuntu : (the "current" Ubuntu. Still Trusty)
  • osx (with ROS indigo)

SSH-Agent

ROSCORE

Prepare Script

Assuming the script is in tools/ci/prepare-jenkins-slave.sh and the repository gets extracted into src/ (Local subdirectory for repo) then this makes Jenkins run it after cloning the repository and its dependencies and before build.

Make sure to not have white spaces in the path to the prepare-jenkins-slave.sh script otherwise Jenkins may fail to execute it.

Example prepare-scripts:

Label

This binds the job to the label ubuntu-test:

Build triggers

Binding a job to GitHub pull requests is configured in Build triggers -> GitHub Pull Request Builder. Especially for open-source repositories, this can cause security issues as a PR can be created by everyone. Therefore Build every pull request automatically without asking (Dangerous!). must be deactivated. See #32.

When a new pull request is opened in the project and the author of the pull request isn't white-listed, builder will ask Can one of the admins verify this patch?. To interact with Jenkins, comment in GitHub using (copied from here):

  • ok to test to accept this pull request for testing
  • test this please for a one time test run
  • add to whitelist to add the author to the whitelist If the build fails for other various reasons you can rebuild.
  • retest this please to start a new build