1 .. _lf-global-jjb-release:
3 #######################
4 Self Serve Release Jobs
5 #######################
7 Self serve release jobs allow a project to create a releases directory and then place a release file in it.
8 Jenkins will pick this up and then promote the artifact from the staging log directory (log_dir) and tag the release
9 with the defined version. maven_central_url is optional
13 Example of a project's release file:
17 $ cat releases/1.0.0.yaml
19 distribution_type: 'maven'
21 project: 'example-test-release'
22 log_dir: 'example-test-release-maven-stage-master/17/'
23 maven_central_url: 'oss.sonatype.org'
27 Example of a terse Jenkins job to call global-jjb macro:
32 name: '{project-name}-gerrit-release-jobs'
33 project: 'example-test-release'
34 build-node: centos7-builder-2c-1g
35 project-name: example-test-release
37 - '{project-name}-gerrit-release-jobs'
41 Example of a verbose Jenkins job to call global-jjb macro:
46 name: '{project-name}-releases-verify'
47 project: 'example-test-release'
48 build-node: centos7-builder-2c-1g
49 project-name: example-test-release
51 - 'gerrit-releases-verify'
56 name: '{project-name}-releases-merge'
57 project: 'example-test-release'
58 build-node: centos7-builder-2c-1g
59 project-name: example-test-release
61 - 'gerrit-releases-merge'
65 Release Engineers Please follow the setup guide before adding the job definition:
67 Setup for LFID Nexus Jenkins and Gerrit:
68 ========================================
73 Create an ``lfid`` and an ``ssh-key``
82 ssh-keygen -t rsa -C "collab-it+odl-release@linuxfoundation.org" -f /tmp/odl-release
85 `Create an LFID <https://identity.linuxfoundation.org>`_
90 Create a Nexus account called ``'jenkins-release'`` with promote privileges.
92 .. image:: ../_static/nexus-promote-privs.png
97 Log into your Gerrit with ``RELEASE_USERNAME``, upload the ``ssh-key`` you created earlier.
98 Log out of Gerrit and log in again with your normal account for the next steps.
100 In Gerrit create a new group called ``self-serve-release`` and give it direct push rights via ``All-Projects``
101 ``push - refs/heads/*``
103 1. Add a push reference
104 2. Set the ref as refs/heads/*
105 3. Make sure "force push" is not checked
107 Add ``RELEASE_USERNAME`` to group ``self-serve-release`` and group ``Non-Interactive Users``
112 Add a global credential to Jenkins called ``jenkins-release`` and set the ID: ``'jenkins-release'``
113 as its value insert the ``ssh-key`` that you uploaded to Gerrit.
115 Add Global vars in Jenkins:
116 Jenkins configre -> Global properties -> Environment variables
118 ``RELEASE_USERNAME = $RELEASE_USERNAME``
119 ``RELEASE_EMAIL = $RELEASE_EMAIL``
121 Add or edit the managed file in Jenkins called ``lftoolsini``, appending a nexus section:
122 Jenkins Settings -> Managed files -> Add (or edit) -> Custom file
127 username=jenkins-release
133 upgrade you projects global-jjb if needed
134 add this to your global defaults file (eg: jjb/defaults.yaml)
138 jenkins-ssh-release-credential: 'jenkins-release'
146 Release verify and merge jobs are the same except for their scm, trigger, and
147 builders definition. This anchor is the common template.
158 - sigul-configuration
159 - checkout ref from taglist.log
160 - applies the $PROJECT.bundle
161 - signs, tags and pushes
165 lftools nexus release --server $NEXUS_URL $STAGING_REPO
169 - {project-name}-release-merge-{stream}
171 :Comment Trigger: remerge
173 :Required parameters:
175 :build-node: The node to run build on.
176 :jenkins-ssh-release-credential: Credential to use for SSH. (Generally set
178 :stream: run this job against: master
180 :Optional parameters:
182 :branch: Git branch to fetch for the build. (default: master)
183 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
184 :build-timeout: Timeout in minutes before aborting build. (default: 15)
185 :project-pattern: Project to trigger build against. (default: \*\*)
187 :gerrit_merge_triggers: Override Gerrit Triggers.
188 :gerrit_trigger_file_paths: Override file paths filter which checks which
189 file modifications will trigger a build.
193 pattern: 'releases/*.yaml'
199 Release verify job checks the schema and ensures that the staging-repo.txt.gz
200 is available on the job.
203 - sigul-configuration
204 - checkout ref from taglist.log
205 - applies the $PROJECT.bundle
206 - signs and shows signature
210 - {project-name}-release-verify-{stream}
212 :Comment Trigger: recheck|reverify
214 :Required Parameters:
216 :build-node: The node to run build on.
217 :jenkins-ssh-release-credential: Credential to use for SSH. (Generally set
219 :stream: run this job against: master
221 :Optional Parameters:
223 :branch: Git branch to fetch for the build. (default: master)
224 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
225 :build-node: The node to run build on.
226 :build-timeout: Timeout in minutes before aborting build. (default: 15)
227 :doc-dir: Directory where tox will place built docs.
228 as defined in the tox.ini (default: docs/_build/html)
229 :gerrit-skip-vote: Skip voting for this job. (default: false)
230 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
231 :project-pattern: Project to trigger build against. (default: \*\*)
233 :gerrit_verify_triggers: Override Gerrit Triggers.
234 :gerrit_trigger_file_paths: Override file paths filter which checks which
235 file modifications will trigger a build.
239 pattern: 'releases/*.yaml'