3 The purpose of this repository is store generically defined, reusable JJB
4 templates, deployable across LF projects.
6 Define the following variables in the Jenkins server as
7 global environment variables as scripts in this repo expect these variables to
13 GIT_URL=ssh://jenkins-$SILO@git.opendaylight.org:29418
14 GIT_CLONE_URL=git@github.com:
15 JENKINS_HOSTNAME=jenkins092
16 LOGS_SERVER=https://logs.opendaylight.org
17 NEXUS_URL=https://nexus.opendaylight.org
21 Note: Use **GIT_CLONE_URL** for GitHub projects as this
22 will be different from the URL used the poperties
25 ## Jenkins Plugin Requirements
29 - Config File Provider
43 ## Installing global-jjb
45 Deploy global-jjb in the ci-management repository's jjb directory as
46 a submodule. Installing, upgrading, and rolling back changes is simple via the
50 # Choose a global-jjb version to install
51 GLOBAL_JJB_VERSION=v0.1.0
53 # Add the new submodule to ci-management's jjb directory.
54 # Note: Perform once per ci-management repo.
56 git submodule add https://gerrit.linuxfoundation.org/infra/releng/global-jjb
58 # Checkout the version of global-jjb you wish to deploy.
60 git checkout $GLOBAL_JJB_VERSION
62 # Commit global-jjb version to the ci-management repo.
64 git add jjb/global-jjb
65 git commit -sm "Install global-jjb $GLOBAL_JJB_VERSION"
67 # Push the patch to ci-management for review
71 ## Parameters stored in defaults.yaml
73 Configure the following parameters in the ci-management repo's
76 **gerrit-server-name**: The name of the Gerrit Server as defined
77 in Gerrit Trigger global configuration.
79 **jenkins-ssh-credential**: The name of the Jenkins Credential to
80 use for ssh connections.
82 If you are using GitHub then configure the following parameters
85 **git-url**: Set this to the base URL of your GitHub repo. In
86 general this should be <https://github.com>. If you are using
87 GitHub Enterprise, or some other GitHub-style system, then it
88 should be whatever your installation base URL is.
90 **git-clone-url**: This is the clone prefix used by GitHub jobs.
91 Set this to either the same thing as **git-url** or the
92 'git@github.com:' including the trailing ':'
94 **github-org**: The name of the GitHub organization interpolated
97 **github_pr_org**: The name of the GitHub organization. All members
98 of this organization will be able to trigger any job using the
99 `lf-infra-github-pr` macro.
101 **github_pr_whitelist**: List of GitHub members you wish to be able to
102 trigger any job that uses the `lf-infra-github-pr-trigger` macro.
104 **github_pr_admin_list**: List of GitHub members that will have admin
105 privileges on any job using the `lf-infra-github-pr-trigger`
115 jenkins-ssh-credential: opendaylight-jenkins-ssh
116 gerrit-server-name: OpenDaylight
122 github_pr_admin_list:
126 ## Config File Management
130 The logs account requires a Maven Settings file created called
131 **jenkins-log-archives-settings** with a server ID of **logs** containing the
132 credentials for the logs user in Nexus.
136 The CI job group contains jobs that should deploy in all LF
137 Jenkins infra. The minimal configuration needed to deploy the ci-management
138 jobs is as follows which deploys the **{project-name}-ci-jobs** job group as
139 defined in **lf-ci-jobs.yaml**.
148 - '{project-name}-ci-jobs'
150 project: ci-management
151 project-name: ci-management
152 build-node: centos7-basebuild-2c-1g
157 **project**: is the project repo as defined in source control.
158 **project-name**: is a custom name to call the job in Jenkins.
159 **build-node**: is the name of the builder to use when building (Jenkins label).
163 **branch**: is the git branch to build from.
164 **jjb-version**: is the version of JJB to install in the build minion.
166 ## Deploying packer-jobs
168 The packer job group contains jobs to build custom minion images. The minimal
169 configuration needed to deploy the packer jobs is as follows which deploys the
170 **{project-name}-packer-jobs** job group as defined in **lf-ci-jobs.yaml**.
179 - '{project-name}-packer-jobs'
181 project: ci-management
182 project-name: ci-management
184 build-node: centos7-basebuild-2c-1g
207 **project**: is the project repo as defined in source control.
208 **project-name**: is a custom name to call the job in Jenkins.
209 **build-node**: is the name of the builder to use when building (Jenkins label).
210 **platforms**: is a list of supported platforms.
211 **templates**: is a list of supported templates.
215 **branch**: is the git branch to build from.
216 **packer-version**: is the version of packer to install in the build minion,
217 when packer is not available.
218 **exclude**: is a combination of platforms and templates which are not required
221 ## Deploying Python jobs
223 We provide the following Python jobs templates:
225 ### {project-name}-tox-verify-{stream}
227 Use this job to call python-tox to run builds and tests. The most common
228 usage of this job is to run the Coala linter against projects.
234 - '{project-name}-tox-verify-{stream}'
236 project-name: builder
237 project: releng/builder
238 build-node: centos7-java-builder-2c-4g
244 **project**: is the project repo as defined in source control.
245 **project-name**: is a custom name to call the job in Jenkins.
246 **build-node**: is the name of the builder to use when building (Jenkins label).
247 **stream**: typically `master` or matching the build branch. This
248 is a useful keywords to map a release codename to a branch. For
249 example OpenDaylight uses this to map stream=carbon to
250 branch=stable/carbon.
254 **branch**: is the git branch to build from.
255 **jjb-version**: is the version of JJB to install in the build minion.
256 **tox-dir**: directory containing tox.ini file (default: '')
257 **tox-envs**: tox environments to run (default: '')
259 ## Archiving logs in Jobs
261 There are 2 ways supported for archiving log information:
263 1) Job creates $WORKSPACE/archives directory and places logs there
265 This method pushes the entire archives directory to the log server
266 in the same structure as configured in the archives directory.
268 2) Via job variable ARCHIVE_ARTIFACTS using globstar patterns.
270 In this method a job can define a globstar for example `**/*.log` which then
271 causes the archive script to do a globstar search for that pattern and archives
272 any files it finds matching.
274 ## Overriding merge and verify triggers
276 The default trigger conditions for Merge and Verify job types are overrideable
277 in a project configuration by overriding the following variables:
279 - gerrit_merge_triggers
280 - gerrit_verify_triggers
282 These variables take a list of trigger-on values as defined in JJB docs here:
283 <https://docs.openstack.org/infra/jenkins-job-builder/triggers.html#triggers.gerrit>
289 When using ShellCheck to lint global-jjb or any projects that include
290 global-jjb as part of their project (common with ci-management repos) then
291 we require version 0.4.x of ShellCheck installed on the build vms. This version
292 introduces annotations used by shell scripts in this repo.