1 # Continuous Integration for O-RAN SC at LF
3 This repo contains configuration files for Jenkins jobs for the O-RAN
6 ## Custom JJB templates for Docker Java projects
8 Custom JJB templates are defined for projects that use Maven to
9 compile Java code and build a Docker image. These projects should use
10 the following jobs in the project.yaml file::
13 - gerrit-maven-docker-verify
14 - gerrit-maven-docker-merge
15 - gerrit-maven-docker-stage
18 ## Testing the templates
20 These instructions explain how to test the templates using the Jenkins
21 sandbox. This catches errors before submitting the changes as Gerrit
26 Install the Jenkins job builder:
28 pip install jenkins-job-builder
30 Check out the global JJB templates submodule within this repo:
32 git submodule update --init
36 Check sanity by running the Jenkins job-builder script in this directory:
38 jenkins-jobs test -r jjb
40 ### Deploy the templates to the Jenkins sandbox
42 Login (after requesting membership in group
43 oran-jenkins-sandbox-access) at the Jenkins sandbox:
45 https://jenkins.o-ran-sc.org/sandbox
47 Get the authentication token from the sandbox:
48 a) click on your user name (top right)
49 b) click Configure (left menu)
50 c) under API Token, click Add new Token (button)
51 d) copy the token string
53 Create a config file jenkins.ini using the following template and your
54 credentials (user name and API token from above)::
58 keep_descriptions=False
62 query_plugins_info=False
63 url=https://jenkins.o-ran-sc.org/sandbox
65 password=YOUR-API-TOKEN
67 Build and deploy a specific job using the EXACT job name.
69 jenkins-jobs --conf jenkins.ini update jjb your-job-name-here
73 jenkins-jobs --conf jenkins.ini update jjb project-maven-docker-verify-master-mvn33-openjdk8
75 In the sandbox visit the job page, then click the button "Build with
76 parameters" in left menu.
78 ### How to build from a Gerrit review branch
80 This explains how to launch a "verify" job in the Sandbox on an open
81 review. Most "verify" jobs accept parameters to build code in a
82 review submitted to Gerrit. You must specify the change ref spec,
83 which is a Git branch name. Get this by inspecting Gerrit's
84 "download" links at the top right. The branch name will be something
89 The first number is a mystery to me; the second number is the Gerrit
90 change number; the third number is the patch set within the change.
92 Enter this name for both the GERRIT_BRANCH and the GERRIT_REFSPEC
93 parameters, then click Build.