5 global-jjb requires configuration in 2 places; ``Jenkins`` and the
6 :term:`ci-management` repository.
13 On the Jenkins side, we need to prep ``environment variables`` and
14 ``plugins`` required by the jobs in global-jjb before we can start our first
17 .. _jenkins-install-plugins:
19 Install Jenkins plugins
20 -----------------------
22 Install the following required Jenkins plugins and any optional ones as
23 necessary by the project.
27 - `Config File Provider <https://plugins.jenkins.io/config-file-provider>`_
28 - `Description Setter <https://plugins.jenkins.io/description-setter>`_
29 - `Environment Injector Plugin <https://plugins.jenkins.io/envinject>`_
30 - `Git plugin <https://plugins.jenkins.io/git>`_
31 - `Post Build Script <https://plugins.jenkins.io/postbuildscript>`_
32 - `SSH Agent <https://plugins.jenkins.io/ssh-agent>`_
33 - `Workspace Cleanup <https://plugins.jenkins.io/ws-cleanup>`_
35 **Required for Gerrit connected systems**
37 - `Gerrit Trigger <https://plugins.jenkins.io/gerrit-trigger>`_
39 **Required for GitHub connected systems**
41 - `GitHub plugin <https://plugins.jenkins.io/github>`_
42 - `GitHub Pull Request Builder <https://plugins.jenkins.io/ghprb>`_
46 - `Mask Passwords <https://plugins.jenkins.io/mask-passwords>`_
47 - `MsgInject <https://plugins.jenkins.io/msginject>`_
48 - `OpenStack Cloud <https://plugins.jenkins.io/openstack-cloud>`_
49 - `Timestamper <https://plugins.jenkins.io/timestamper>`_
56 The :ref:`lf-global-jjb-jenkins-cfg-merge` job can manage environment variables
57 job but we must first bootstrap them in Jenkins so that the job can run and
62 GIT_URL=ssh://jenkins-$SILO@git.opendaylight.org:29418
63 JENKINS_HOSTNAME=jenkins092
64 NEXUS_URL=https://nexus.opendaylight.org
66 SONAR_URL=https://sonar.opendaylight.org
70 GERRIT_URL=https://git.opendaylight.org/gerrit
74 GIT_URL=https://github.com
75 GIT_CLONE_URL=git@github.com:
79 Use ``GIT_CLONE_URL`` for GitHub projects as this will be different from the
80 URL used in the properties configuration.
84 LOGS_SERVER=https://logs.opendaylight.org
88 #. Navigate to https://jenkins.example.org/configure
89 #. Configure the environment variables as described above
90 #. Configure the same environment variables in the :term:`ci-management` repo
92 .. _jenkins-ci-management:
97 :term:`ci-management` is a git repository containing :term:`JJB` configuration
98 files for Jenkins Jobs. Deploying Global JJB here as a submodule allows us easy
99 management to install, upgrade, and rollback changes via git tags. Install
100 Global JJB as follows:
102 #. Install Global JJB
106 GLOBAL_JJB_VERSION=v0.1.0
107 git submodule add https://github.com/lfit/releng-global-jjb.git global-jjb
109 git checkout $GLOBAL_JJB_VERSION
113 mkdir -p jjb/global-jjb
114 ln -s ../../global-jjb/jenkins-init-scripts jjb/global-jjb/jenkins-init-scripts
115 ln -s ../../global-jjb/shell jjb/global-jjb/shell
116 ln -s ../../global-jjb/jjb jjb/global-jjb/jjb
117 git add jjb/global-jjb
119 git commit -sm "Install global-jjb $GLOBAL_JJB_VERSION"
123 We are purposely using github for production deploys of global-jjb so that
124 uptime of LF Gerrit does not affect projects using global-jjb. In a test
125 environment we can use
126 https://gerrit.linuxfoundation.org/infra/releng/global-jjb if desired.
128 #. Setup ``jjb/defaults.yaml``
130 Create and configure the following parameters in the
131 ``jjb/defaults.yaml`` file as described in the
132 `defaults.yaml configuration docs <defaults-yaml>`.
134 Once configured commit the modifications:
138 git add jjb/defaults.yaml
139 git commit -sm "Setup defaults.yaml"
141 #. Push patches to Gerrit / GitHub using your favourite push method
143 At this point global-jjb installation is complete in the :term:`ci-management`
144 repo and is ready for use.
151 The CI job group contains jobs that should deploy in all LF
152 Jenkins infra. The minimal configuration to deploy the
153 **{project-name}-ci-jobs** job group as defined in **lf-ci-jobs.yaml** is as
156 jjb/ci-management/ci-management.yaml:
164 - '{project-name}-ci-jobs'
166 project: ci-management
167 project-name: ci-management
168 build-node: centos7-builder-2c-1g
170 **Required parameters**:
172 :project: The project repo as defined in source control.
173 :project-name: A custom name to call the job in Jenkins.
174 :build-node: The name of the builder to use when building (Jenkins label).
176 **Optional parameters**:
178 :branch: The git branch to build from. (default: master)
179 :jjb-version: The version of JJB to install in the build minion. (default:
180 <defined by the global-jjb project>)
182 .. _deploy-packer-jobs:
187 The packer job group contains jobs to build custom minion images. The minimal
188 configuration needed to deploy the packer jobs is as follows which deploys the
189 **{project-name}-packer-jobs** job group as defined in **lf-ci-jobs.yaml**.
191 jjb/ci-management/packer.yaml:
196 name: packer-builder-jobs
199 - '{project-name}-packer-jobs'
201 project: ci-management
202 project-name: ci-management
204 build-node: centos7-builder-2c-1g
213 name: packer-docker-jobs
216 - '{project-name}-packer-jobs'
218 project: ci-management
219 project-name: ci-management
221 build-node: centos7-builder-2c-1g
229 **Required parameters**:
231 :project: The project repo as defined in source control.
232 :project-name: A custom name to call the job in Jenkins.
233 :build-node: The name of the builder to use when building (Jenkins label).
234 :platforms: A list of supported platforms.
235 :templates: A list of templates to build. We recommend setting one template per
236 ``project`` section so that we can control which platforms to build for
239 **Optional parameters**:
241 :branch: The git branch to build from. (default: master)
242 :packer-version: The version of packer to install in the build minion,
243 when packer is not available. (default: <defined by global-jjb>)