Skip to content

Jenkins Configuration

Frantisek Sumsal edited this page Mar 3, 2019 · 10 revisions

As the background part of the CI is as important as the one in this repository, I'll try to describe it as well as I can for future reference.

systemd-pr-build

This job is the main CI for the https://github.com/systemd/systemd repository. Configuration is as follows:

General

  • Discard old builds
    • (Advanced) Days to keep artifacts: 180
  • GitHub project
    • Project url: https://github.com/systemd/systemd

ZMQ Event Publisher

  • Execute concurrent builds if necessary
  • Restrict where this project can be run
    • Label Expression: systemd-ci-slave01
  • (Advanced) Use custom workspace
    • Directory: workspace/systemd-pr-build-$BUILD-NUMBER

Source Code Management

  • Git
    • Repositories
      • Repository URL: https://github.com/systemd/systemd.git
    • Branches to build
      • Branch Specifier: */master

Build Triggers

  • GitHub Pull Request Builder
    • GitHub API credentials: https://api.github.com : Systemd Connection to Github (token)
    • Use github hooks for build triggering
    • (Advanced) Build every pull request automatically without asking
    • (Advanced) Trigger Setup
      • (Add): Cancel build on update

Build Environment

  • Delete workspace before build starts

Build

  • Execute shell
    • Command
#!/bin/sh

export PATH="/home/systemd/bin:$PATH"
ARGS=

if [ "$ghprbPullId" ]; then
	ARGS="$ARGS --pr $ghprbPullId "
fi

git clone https://github.com/systemd/systemd-centos-ci
cd systemd-centos-ci


./agent-control.py $ARGS

Post-build actions

  • Archive the artifacts
    • Files to archive: systemd-centos-ci/artifacts_*/,systemd-centos-ci/index.html*
  • Delete workspace when build is done

systemd-ci-build

This jobs works as a CI for the CI repository - in other words, it's the most convenient way to check if changes to the CI machinery didn't break something when run in the production environment.

General

  • Discard old builds
    • (Advanced) Days to keep artifacts: 90
  • GitHub project
    • Project url: https://github.com/systemd/systemd-centos-ci/

ZMQ Event Publisher

  • Execute concurrent builds if necessary
  • Restrict where this project can be run
    • Label Expression: systemd-ci-slave01
  • (Advanced) Use custom workspace
    • Directory: workspace/systemd-ci-build-$BUILD-NUMBER

Source Code Management

  • Git
    • Repositories
      • Repository URL: https://github.com/systemd/systemd-centos-ci.git
    • Branches to build
      • Branch Specifier: ${ghprbActualCommit}

Build Triggers

  • GitHub Pull Request Builder
    • GitHub API credentials: https://api.github.com : Systemd Connection to Github (token)
    • Use github hooks for build triggering
    • (Advanced) Build every pull request automatically without asking
    • (Advanced) Trigger Setup
      • (Add): Cancel build on update

Build Environment

  • Delete workspace before build starts

Build

  • Execute shell
    • Command
#!/bin/sh

export PATH="/home/systemd/bin:$PATH"
ARGS=

if [ "$ghprbPullId" ]; then
	ARGS="$ARGS --ci-pr $ghprbPullId "
fi

./agent-control.py $ARGS
./agent-control.py --rhel --branch staging $ARGS
./agent-control.py --rhel --branch staging-next $ARGS
./agent-control.py --rhel --vagrant $ARGS
# Generate a correct index using all collected artifacts
# Unfortunately, it will contain files from the systemd-centos-ci repository
# but it's still better than going through all artifacts manually
utils/generate-index.sh . index.html

Post-build actions

  • Archive the artifacts
    • Files to archive: artifacts_*/,index.html*
  • Delete workspace when build is done