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
109 git checkout $GLOBAL_JJB_VERSION
111 git add jjb/global-jjb
115 ln -s ../../global-jjb/shell jjb/global-jjb/shell
116 ln -s ../../global-jjb/jjb jjb/global-jjb/jjb
117 ln -s ../../global-jjb/jenkins-admin jjb/global-jjb/jenkins-admin
118 ln -s ../../global-jjb/jenkins-init-scripts jjb/global-jjb/jenkins-init-scripts
119 git add jjb/global-jjb
121 git commit -sm "Install global-jjb $GLOBAL_JJB_VERSION"
125 We are purposely using github for production deploys of global-jjb so that
126 uptime of LF Gerrit does not affect projects using global-jjb. In a test
127 environment we can use
128 https://gerrit.linuxfoundation.org/infra/releng/global-jjb if desired.
130 #. Setup ``jjb/defaults.yaml``
132 Create and configure the following parameters in the
133 ``jjb/defaults.yaml`` file as described in the
134 `defaults.yaml configuration docs <defaults-yaml>`.
136 Once configured commit the modifications:
140 git add jjb/defaults.yaml
141 git commit -sm "Setup defaults.yaml"
143 #. Push patches to Gerrit / GitHub using your favourite push method
145 At this point global-jjb installation is complete in the :term:`ci-management`
146 repo and is ready for use.
153 The CI job group contains jobs that should deploy in all LF
154 Jenkins infra. The minimal configuration to deploy the
155 **{project-name}-ci-jobs** job group as defined in **lf-ci-jobs.yaml** is as
158 jjb/ci-management/ci-management.yaml:
166 - '{project-name}-ci-jobs'
168 project: ci-management
169 project-name: ci-management
170 build-node: centos7-builder-2c-1g
172 **Required parameters**:
174 :project: The project repo as defined in source control.
175 :project-name: A custom name to call the job in Jenkins.
176 :build-node: The name of the builder to use when building (Jenkins label).
178 **Optional parameters**:
180 :branch: The git branch to build from. (default: master)
181 :jjb-version: The version of JJB to install in the build minion. (default:
182 <defined by the global-jjb project>)
184 .. _deploy-packer-jobs:
189 The packer job group contains jobs to build custom minion images. The minimal
190 configuration needed to deploy the packer jobs is as follows which deploys the
191 **{project-name}-packer-jobs** job group as defined in **lf-ci-jobs.yaml**.
193 jjb/ci-management/packer.yaml:
198 name: packer-builder-jobs
201 - '{project-name}-packer-jobs'
203 project: ci-management
204 project-name: ci-management
206 build-node: centos7-builder-2c-1g
215 name: packer-docker-jobs
218 - '{project-name}-packer-jobs'
220 project: ci-management
221 project-name: ci-management
223 build-node: centos7-builder-2c-1g
231 **Required parameters**:
233 :project: The project repo as defined in source control.
234 :project-name: A custom name to call the job in Jenkins.
235 :build-node: The name of the builder to use when building (Jenkins label).
236 :platforms: A list of supported platforms.
237 :templates: A list of templates to build. We recommend setting one template per
238 ``project`` section so that we can control which platforms to build for
241 **Optional parameters**:
243 :branch: The git branch to build from. (default: master)
244 :packer-version: The version of packer to install in the build minion,
245 when packer is not available. (default: <defined by global-jjb>)