Skip to content

Jenkins configuration

Linus Tolke edited this page Aug 12, 2022 · 16 revisions

The Jenkins server

This is the description of how the Jenkins server is set up. The Jenkins server build and updates the mvn site and deploy of snapshots based on the master branches. It also verifies changes in gerrithub.

The current configuration will:

  • Build a gerrit change immediately when it is posted,
  • Trigger a build of a merged change on master within the hour.
  • Find new projects in the argouml-tigris-org organization within a day.

How the Jenkins server is set up

This currently requires the latest/beta channel of Jenkins (2.325) because of problems with getting a working set of modules loaded in Jenkins.

  1. Install the snap version of jenkins sudo snap install jenkins --classic and docker.
  2. Add the following modules in the wizard:
    • Folders cloudbees-folder
    • OWASP Markup Formatter antisamy-markup-formatter
    • Build Timeout build-timeout
    • Config File Provider config-file-provider
    • Credentials Binding credentials-binding
    • Timestamper timestamper
    • Workspace Cleanup ws-cleanup
    • JUnit junit
    • Warnings Next Generation warnings-ng
    • Pipeline workflow-aggregator
    • GitHub Branch Source github-branch-source
    • Pipeline: Stage View pipeline-stage-view
    • Conditional BuildStep conditional-buildstep
    • Multijob jenkins-multijob-plugin
    • Parameterized Trigger parameterized-trigger
    • Git git
    • GitHub github
    • Matrix Project matrix-project
    • Mailer mailer
  3. Add the following plugins to Jenkins:
    • Docker Pipeline docker-workflow
    • Docker Commons docker-commons
    • Gerrit Code Review gerrit-code-review
    • Pipeline Maven Integration pipeline-maven
    • Remote Jenkinsfile Plugin remote-file
  4. Create the credentials according to the description below.
  5. Create the volume maven-repo in docker docker volume create maven-repo and set the rights on it docker run --rm -v maven-repo:/mr maven:3-ibmjava-8 chmod 777 /mr.
  6. Copy the configuration files:
    • sudo cp -r setup/desktop/jenkins-jobs/{gerrithub,github-organization} /var/snap/jenkins/current/jobs/
  7. In Jenkins: Reload the configuration from disk.
  8. In the github-organization job scan and then run the found jobs in the following order: tools, testmodels, parentpom, argouml, test-i18-properties and then everything else including scanning the Gerrithub job.

Credentials in Jenkins

In the Store scoped to Jenkins, in the Global credentials do Add Credentials for these three credentials:

  • Gerrithub User for Verification: This is used by the gerritReview command to Verify a change.

    • Kind: Username with password
    • Scope: Global
    • Username: the user name of the github user that is member of the ArgoUML-verifiers group on gerrithub.
    • Password: The HTTP Credentials of the user on gerrithub.
    • ID: gerrithub-user
    • Description as above.
  • Scripted user for Github: This is used to upload gh-pages from the github-organization jobs.

    • Kind: Username with password
    • Scope: Global
    • Username: the user name of the github user that is member of the acting-from-scripts group (secret) on github.
    • Password: The Personal access token of the user on github. This token requires the repo and user:email scopes.
    • ID: github
    • Description as above.
  • ID: sonatype (User for uploading snapshots.) with the user name and password used to upload snapshots at sonatype.

  • Add a Maven settings file with ID: github. Add the Server Credentials for Scripted user for Github with ServerId github.

  • Add a Maven settings file with ID: sonatype. Add the Server Credentials for User for uploading snapshots with ServerId sonatype-nexus-snapshots.

  • Add a Credentials System called System.