3 The purpose of this repository is store generically define reusable JJB
4 templates that can be deployed across LF projects.
6 The following variables are necessary to be defined 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 JENKINS_HOSTNAME=jenkins092
15 LOGS_SERVER=https://logs.opendaylight.org
16 NEXUS_URL=https://nexus.opendaylight.org
20 ## Jenkins Plugin Requirements
24 - Config File Provider
38 ## Installing global-jjb
40 global-jjb should be deployed in the ci-management repository's jjb directory as
41 a submodule. global-jjb is versioned and tagged in Gerrit so installing,
42 upgrading, and rolling back changes should be simple via the Gerrit tag system.
45 # Choose a global-jjb version to install
46 GLOBAL_JJB_VERSION=v0.1.0
48 # Add the new submodule to ci-management's jjb directory.
49 # Note: Only needs to be performed once per ci-management repo.
51 git submodule add https://gerrit.linuxfoundation.org/infra/releng/global-jjb
53 # Checkout the version of global-jjb you wish to deploy.
55 git checkout $GLOBAL_JJB_VERSION
57 # Commit global-jjb version to the ci-management repo.
59 git add jjb/global-jjb
60 git commit -sm "Install global-jjb $GLOBAL_JJB_VERSION"
62 # Push the patch to ci-management for review
66 ## Parameters stored in defaults.yaml
68 There are a few project specific parameters that should be stored in the
69 ci-management repo's defaults.yaml file.
71 **gerrit-server-name**: The name of the Gerrit Server as defined in Gerrit
72 Trigger global configuration.
74 **jenkins-ssh-credential**: The name of the Jenkins Credential to use for ssh
77 If you are using GitHub then there are two more parameters which
78 will need to be placed in the defaults.yaml
80 **github-url**: The URL of GitHub. (Default: https://github.com)
82 **github-org**: The name of the GitHub organization.
91 jenkins-ssh-credential: opendaylight-jenkins-ssh
92 gerrit-server-name: OpenDaylight
96 ## Config File Management
100 The logs account requires a Maven Settings file created called
101 **jenkins-log-archives-settings** with a server ID of **logs** containing the
102 credentials for the logs user in Nexus.
106 The CI job group contains multiple jobs that should be deployed in all LF
107 Jenkins infra. The minimal configuration needed to deploy the ci-management
108 jobs is as follows which deploys the **{project-name}-ci-jobs** job group as
109 defined in **lf-ci-jobs.yaml**.
118 - '{project-name}-ci-jobs'
120 project: ci-management
121 project-name: ci-management
122 build-node: centos7-basebuild-2c-1g
127 **project**: is the project repo as defined in source control.
128 **project-name**: is a custom name to call the job in Jenkins.
129 **build-node**: is the name of the builder to use when building (Jenkins label).
133 **branch**: is the git branch to build from.
134 **jjb-version**: is the version of JJB to install in the build minion.
136 ## Deploying Python jobs
138 We provide the following Python jobs templates:
140 ### {project-name}-tox-verify-{stream}
142 This job can be used to call python-tox to run builds and tests. The most common
143 usage of this job is to run the Coala linter against projects.
149 - '{project-name}-tox-verify-{stream}'
151 project-name: builder
152 project: releng/builder
153 build-node: centos7-java-builder-2c-4g
159 **project**: is the project repo as defined in source control.
160 **project-name**: is a custom name to call the job in Jenkins.
161 **build-node**: is the name of the builder to use when building (Jenkins label).
162 **stream**: typically `master` or matching whatever branch is being built. This
163 is a useful keywords to map a release codename to a branch. For
164 example OpenDaylight uses this to map stream=carbon to
165 branch=stable/carbon.
169 **branch**: is the git branch to build from.
170 **jjb-version**: is the version of JJB to install in the build minion.
171 **tox-dir**: directory containing tox.ini file (default: '')
172 **tox-envs**: tox environments to run (default: '')
174 ## Archiving logs in Jobs
176 There are 2 ways supported for archiving log information:
178 1) Job creates $WORKSPACE/archives directory and places logs there
180 In this method the entire archives directory will be pushed to the log server
181 in the same structure as configured in the archives directory.
183 2) Via job variable ARCHIVE_ARTIFACTS using globstar patterns.
185 In this method a job can define a globstar for example ``**/*.log`` which then
186 causes the archive script to do a globstar search for that pattern and archives
187 any files it finds matching.