7 name: lf-fetch-dependent-patches
9 - shell: !include-raw: ../shell/gerrit-fetch-dependencies.sh
11 properties-file: $WORKSPACE/.dependency.properties
14 name: lf-license-check
18 FILE_PATTERNS={file-patterns}
19 SPDX_DISABLE={spdx-disable}
20 LHC_VERSION={lhc-version}
21 LICENSE_EXCLUDE_PATHS={license-exclude-paths}
22 LICENSES_ALLOWED={licenses-allowed}
23 - shell: !include-raw-escape:
24 - ../shell/license-check.sh
27 name: lf-infra-create-netrc
30 properties-content: 'SERVER_ID={server-id}'
31 - shell: !include-raw-escape: ../shell/create-netrc.sh
34 name: lf-infra-docker-login
36 - lf-provide-maven-settings:
37 global-settings-file: '{global-settings-file}'
38 settings-file: '{settings-file}'
39 - shell: !include-raw-escape: ../shell/docker-login.sh
40 - lf-provide-maven-settings-cleanup
43 name: lf-infra-gpg-verify-git-signature
44 # TODO: Verify signature after downloading users public key from a locally
45 # created repository instead of the public keymesh. This requires a process
46 # in place to get ODL developers public keys into a local repository without
47 # increasing the job thoughput.
49 - shell: !include-raw: ../shell/gpg-verify-git-signature.sh
52 name: lf-infra-pre-build
54 - shell: !include-raw-escape: ../shell/python-tools-install.sh
57 name: lf-infra-ship-logs
59 - config-file-provider:
61 - file-id: 'jenkins-log-archives-settings'
62 variable: 'SETTINGS_FILE'
63 - lf-infra-create-netrc:
65 - shell: !include-raw:
66 # Ensure python-tools are installed in case job template does not
67 # call the lf-infra-pre-build macro.
68 - ../shell/python-tools-install.sh
69 - ../shell/logs-deploy.sh
70 - shell: !include-raw:
71 - ../shell/logs-clear-credentials.sh
73 regexp: '^Build logs: .*'
76 name: lf-infra-package-listing
78 - shell: !include-raw:
79 - ../shell/package-listing.sh
82 name: lf-infra-packer-build
85 condition-kind: boolean-expression
86 condition-expression: '{openstack}'
88 - config-file-provider:
90 - file-id: clouds-yaml
91 target: '$HOME/.config/openstack/clouds.yaml'
93 properties-content: OS_CLOUD={openstack-cloud}
94 - config-file-provider:
96 - file-id: '{packer-cloud-settings}'
100 PACKER_PLATFORM={platform}
101 PACKER_TEMPLATE={template}
102 PACKER_VERSION={packer-version}
103 - shell: !include-raw-escape:
104 - ../shell/packer-install.sh
105 - ../shell/packer-build.sh
106 - shell: !include-raw:
107 - ../shell/packer-clear-credentials.sh
110 name: lf-infra-packer-validate
112 - config-file-provider:
114 - file-id: '{packer-cloud-settings}'
117 properties-content: |
118 PACKER_VERSION={packer-version}
119 - shell: !include-raw-escape:
120 - ../shell/packer-install.sh
121 - ../shell/packer-validate.sh
122 - shell: !include-raw:
123 - ../shell/packer-clear-credentials.sh
126 name: lf-infra-push-gerrit-patch
129 properties-content: |
131 GERRIT_COMMIT_MESSAGE={gerrit-commit-message}
132 GERRIT_HOST={gerrit-host}
133 GERRIT_TOPIC={gerrit-topic}
134 GERRIT_USER={gerrit-user}
135 REVIEWERS_EMAIL={reviewers-email}
136 - shell: !include-raw-escape: ../shell/gerrit-push-patch.sh
139 name: lf-infra-sysstat
141 - shell: !include-raw:
142 - ../shell/sysstat.sh
145 name: lf-jacoco-nojava-workaround
147 - shell: 'mkdir -p $WORKSPACE/target/classes $WORKSPACE/jacoco/classes'
150 name: lf-infra-deploy-maven-file
153 mvn-version: '{mvn-version}'
154 - lf-provide-maven-settings:
155 global-settings-file: '{global-settings-file}'
156 settings-file: '{settings-file}'
158 properties-content: |
159 MAVEN_REPO_URL={maven-repo-url}
162 UPLOAD_FILES_PATH={upload-files-dir}
163 - shell: !include-raw-escape:
164 - ../shell/lftools-install.sh
165 - ../shell/common-variables.sh
166 - ../shell/deploy-maven-file.sh
167 - lf-provide-maven-settings-cleanup
170 name: lf-maven-install
172 # Create a $HOME/.wgetrc to make the Maven download quiet.
173 - shell: 'echo "quiet=on" > "$HOME/.wgetrc"'
175 maven-version: '{mvn-version}'
177 - shell: 'rm "$HOME/.wgetrc"'
180 name: lf-provide-maven-settings
182 - config-file-provider:
184 - file-id: '{global-settings-file}'
185 variable: 'GLOBAL_SETTINGS_FILE'
186 - file-id: '{settings-file}'
187 variable: 'SETTINGS_FILE'
193 properties-content: PIP_PACKAGES={pip-packages}
194 - shell: !include-raw-escape: ../shell/pip-install.sh
197 name: lf-provide-maven-settings-cleanup
201 set +e # DO NOT cause build failure if any of the rm calls fail.
203 rm -f "$GLOBAL_SETTINGS_FILE" "$SETTINGS_FILE"
205 # In some cases we use the lf-provide-maven-settings macro to produce
206 # a "$HOME/.netrc" file containing credentials. Remove that file here
210 # DO NOT fail build if any of the above lines fail.
214 name: lf-rtd-trigger-build
217 properties-content: |
218 RTD_BUILD_URL={rtd-build-url}
219 RTD_TOKEN={rtd-token}
220 - shell: !include-raw-escape: ../shell/rtd-trigger-build.sh
226 properties-content: DOC_DIR={doc-dir}
227 - shell: !include-raw-escape:
228 - ../shell/tox-install.sh
229 - ../shell/rtd-verify.sh
232 name: lf-sigul-sign-dir
233 # Requires that Jenkins be configured with SIGUL_BRIDGE_IP as a global
234 # Environment variable
237 condition-kind: boolean-expression
238 condition-expression: '{sign-artifacts}'
240 - config-file-provider:
242 - file-id: sigul-config
243 variable: SIGUL_CONFIG
244 - file-id: sigul-password
245 variable: SIGUL_PASSWORD
248 - shell: !include-raw-escape: ../shell/sigul-configuration.sh
249 - shell: !include-raw-escape: ../shell/sigul-install.sh
251 properties-content: SIGN_DIR={sign-dir}
252 - shell: !include-raw-escape:
253 - ../shell/common-variables.sh
254 - ../shell/sigul-sign-dir.sh
255 - shell: !include-raw-escape: ../shell/sigul-configuration-cleanup.sh
258 name: lf-infra-provide-docker-cleanup
262 set +e # DO NOT cause build failure if docker rmi fails
263 docker rmi -f $(docker images -a -q)
272 name: lf-clm-parameters
276 default: '{nexus-iq-stage}'
278 Stage the policy evaluation will be run against on the Nexus IQ Server.
281 name: lf-cmake-parameters
282 # Parameters useful in CMake builds.
286 default: '{build-dir}'
287 description: 'Directory to build the project in.'
290 default: '{cmake-opts}'
292 Options to pass to CMAKE.
293 Example: -DCMAKE_INSTALL_PREFIX=$WORKSPACE/target/output
296 default: '{install-prefix}'
297 description: 'Install prefix for C/C++ builds. Example: /usr/local'
300 default: '{make-opts}'
301 description: 'Options to pass to make. Example: -j8'
304 name: lf-infra-maven-parameters
308 # Sets an env var for shell scripts to be able to call the dynamically
309 # installed maven without having to calculate the M2_HOME themselves.
310 default: '/w/tools/hudson.tasks.Maven_MavenInstallation/{mvn-version}'
311 description: 'Maven selector to be used by shell scripts'
314 default: '{mvn-opts}'
316 Maven Java opts. Example: -Xmx1024m -XX:MaxPermSize=256m
319 default: '{mvn-params}'
321 Maven parameters to pass to the mvn command.
324 # Sets an env var for shell scripts to be able to call the dynamically
325 # installed maven without having to calculate the path themselves.
326 # yamllint disable-line rule:line-length
327 default: '/w/tools/hudson.tasks.Maven_MavenInstallation/{mvn-version}/bin/mvn'
328 description: 'Maven selector to be used by shell scripts'
331 name: lf-infra-openstack-parameters
335 default: '{os-cloud}'
337 The name of a cloud configuration in clouds.yaml. OS_CLOUD is a
338 variable name that is significant to openstack client as a
339 environment variable. Please refer to the documentation for
341 https://docs.openstack.org/developer/python-openstackclient/
345 name: lf-infra-parameters
346 # Standard parameters used in the LF CI environments. Gerrit variables are
347 # not used by GitHub projects, but defining them isn't harmful.
353 Parameter to identify a SCM project to build. This is typically
354 the project repo path. For example: ofextensions/circuitsw
359 Stream is often set to the same name as 'branch' but can
360 sometimes be used as a name representing a project's release code
366 Gerrit Trigger provided parameter to identify Gerrit project that
367 triggered the build. This is typically the project repo path as
368 exists in Gerrit. For example: ofextensions/circuitsw
370 If using Gerrit, in a manual build this should match the PROJECT
376 Gerrit Trigger provided parameter to identify a Gerrit branch.
378 If using Gerrit, in a manual build override with the branch to
382 default: 'refs/heads/{branch}'
384 Gerrit Trigger provided parameter to identify a refspec to fetch
387 If using Gerrit, in a manual build override with a refspec.
388 https://git-scm.com/book/en/v2/Git-Internals-The-Refspec
389 For example: 'refs/heads/master'
392 default: 'origin/{branch}'
394 GitHub PR Trigger provided parameter for specifying the commit
397 If using GitHub, in a manual build override with a branch path or
398 sha1 hash to a specific commit. For example: 'origin/master'
401 name: LFTOOLS_VERSION
402 default: '{lftools-version}'
404 Version of lftools to install. Can be a specific version like
405 '0.6.0' or a PEP-440 definition.
406 https://www.python.org/dev/peps/pep-0440/
407 For example '<1.0.0' or '>=1.0.0,<2.0.0'.
410 name: lf-infra-node-parameters
414 default: '{node-dir}'
415 description: Path to a Node project directory.
418 default: '{node-version}'
419 description: Version of NodeJS to install.
422 name: lf-infra-tox-parameters
428 Path to directory containing tox.ini file.
431 default: '{tox-envs}'
433 Tox environments to run build against.
434 Example: docs,py2,py3
441 name: lf-infra-properties
444 # Allow build data to be stored at a length configured by the
445 # downstream project.
446 days-to-keep: '{build-days-to-keep}'
447 # Do not allow artifacts to be stored in Jenkins.
448 artifact-num-to-keep: 0
455 name: lf-jacoco-report
458 exec-pattern: "**/**.exec"
459 class-pattern: "**/classes"
460 source-pattern: "**/src/main/java"
461 # yamllint disable-line rule:line-length
462 exclusion-pattern: "**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**"
473 name: lf-infra-publish
474 # lf-infra macro to finish up a build.
476 # Handles the following:
477 # - Shipping logs to Nexus logs site repository
478 # - Cleanup workspace
491 - lf-infra-package-listing
493 mark-unstable-if-failed: true
496 # Do not clean up *.jenkins-trigger files for jobs that use a
497 # properties file as input for triggering another build.
498 - '**/*.jenkins-trigger'
506 name: lf-infra-gerrit-scm
509 credentials-id: '{jenkins-ssh-credential}'
513 - 'refs/heads/{branch}'
517 recursive: '{submodule-recursive}'
518 choosing-strategy: '{choosing-strategy}'
521 name: lf-infra-github-scm
524 credentials-id: '{jenkins-ssh-credential}'
532 recursive: '{submodule-recursive}'
533 choosing-strategy: '{choosing-strategy}'
540 name: lf-infra-wrappers
545 timeout: '{build-timeout}'
546 timeout-var: 'BUILD_TIMEOUT'
549 - ssh-agent-credentials:
551 - '{jenkins-ssh-credential}'
554 - config-file-provider:
557 target: '$HOME/.npmrc'
559 target: '$HOME/.config/pip/pip.conf'