Feat!: Update JJB version to 6x

Jenkins Job Builder 6.0.0 is released and breaks backward
compatibility with 5.1.0.

The breaking changes with previous 5.1.0 release:

- Jobs are now expanded the same way as job templates.
- Macros without parameters are now expanded the same way as macros
  with parameters.
- Tags !include-raw: and !include-raw-escape: should now be used the
  same way in jobs and macros without parameters as they are used in
  job templates and macros with parameters.
- Update pre-commit dependencies

Ref:
https://storyboard.openstack.org/#!/story/2010963
https://storyboard.openstack.org/#!/story/2010588

NOTE: Set the var "JJB_VERSION" to "6.0.0" at the GH orginazation
level for GHA JJB Verify to pick up the latest version of JJB.

Issue: LF-JIRA RELENG-5119
Change-Id: I48f25c2e3153d93fed5c69123652513258653437
Signed-off-by: Anil Belur <abelur@linuxfoundation.org>
3 files changed
tree: 3f7d26b938df4c0427422e5a27d9f4e111d25abc
  1. .github/
  2. docker/
  3. jenkins-config/
  4. jjb/
  5. packer/
  6. .coafile
  7. .gitignore
  8. .gitmodules
  9. .gitreview
  10. .pre-commit-config.yaml
  11. .yamllint
  12. INFO.yaml
  13. README.md
  14. tox.ini
README.md

Continuous Integration for O-RAN SC at LF

This repo contains configuration files for Jenkins jobs for the O-RAN SC project.

Defaults.yaml

To avoid repetition, many required configuration parameter values are defined in the defaults.yaml file.

Custom JJB templates for Docker CI PackageCloud projects

Custom JJB templates are defined for projects that use Docker to compile code and build DEB/RPM packages, then push the packages to PackageCloud.io. These projects should use the following jobs in their respective project.yaml file::

jobs:
  - gerrit-docker-verify
  - oran-gerrit-docker-ci-pc-merge

Testing the templates

These instructions explain how to test the templates using the Jenkins sandbox. This catches errors before submitting the changes as Gerrit reviews.

Prerequisites

Install the Jenkins job builder:

pip install jenkins-job-builder

Check out the global JJB templates submodule within this repo:

git submodule update --init

Test Locally

Check sanity by running the Jenkins job-builder script in this directory:

jenkins-jobs test -r jjb

Deploy the templates to the Jenkins sandbox

Login (after requesting membership in group oran-jenkins-sandbox-access) at the Jenkins sandbox:

https://jenkins.o-ran-sc.org/sandbox

Get the authentication token from the sandbox: a) click on your user name (top right) b) click Configure (left menu) c) under API Token, click Add new Token (button) d) copy the token string

Create a config file jenkins.ini using the following template and your credentials (user name and API token from above)::

[job_builder]
ignore_cache=True
keep_descriptions=False
recursive=True

[jenkins]
query_plugins_info=False
url=https://jenkins.o-ran-sc.org/sandbox
user=YOUR-USER-NAME
password=YOUR-API-TOKEN

Build and deploy a specific job using the EXACT job name.

jenkins-jobs --conf jenkins.ini update jjb your-job-name-here

Examples:

jenkins-jobs --conf jenkins.ini update jjb project-maven-docker-verify-master-mvn33-openjdk8

In the sandbox visit the job page, then click the button "Build with parameters" in left menu.

How to build from a Gerrit review branch

This explains how to launch a "verify" job in the Sandbox on an open review. Most "verify" jobs accept parameters to build code in a review submitted to Gerrit. You must specify the change ref spec, which is a Git branch name. Get this by inspecting Gerrit's "download" links at the top right. The branch name will be something like this:

refs/changes/78/578/2

The first number is a mystery to me; the second number is the Gerrit change number; the third number is the patch set within the change.

Enter this name for both the GERRIT_BRANCH and the GERRIT_REFSPEC parameters, then click Build.