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: ../shell/tox-install.sh
228 - shell: !include-raw-escape: ../shell/rtd-verify.sh
231 name: lf-sigul-sign-dir
232 # Requires that Jenkins be configured with SIGUL_BRIDGE_IP as a global
233 # Environment variable
236 condition-kind: boolean-expression
237 condition-expression: '{sign-artifacts}'
239 - config-file-provider:
241 - file-id: sigul-config
242 variable: SIGUL_CONFIG
243 - file-id: sigul-password
244 variable: SIGUL_PASSWORD
247 - shell: !include-raw-escape: ../shell/sigul-configuration.sh
248 - shell: !include-raw-escape: ../shell/sigul-install.sh
250 properties-content: SIGN_DIR={sign-dir}
251 - shell: !include-raw-escape:
252 - ../shell/common-variables.sh
253 - ../shell/sigul-sign-dir.sh
254 - shell: !include-raw-escape: ../shell/sigul-configuration-cleanup.sh
257 name: lf-infra-provide-docker-cleanup
261 set +e # DO NOT cause build failure if docker rmi fails
262 docker rmi -f $(docker images -a -q)
271 name: lf-clm-parameters
275 default: '{nexus-iq-stage}'
277 Stage the policy evaluation will be run against on the Nexus IQ Server.
280 name: lf-cmake-parameters
281 # Parameters useful in CMake builds.
285 default: '{build-dir}'
286 description: 'Directory to build the project in.'
289 default: '{cmake-opts}'
291 Options to pass to CMAKE.
292 Example: -DCMAKE_INSTALL_PREFIX=$WORKSPACE/target/output
295 default: '{install-prefix}'
296 description: 'Install prefix for C/C++ builds. Example: /usr/local'
299 default: '{make-opts}'
300 description: 'Options to pass to make. Example: -j8'
303 name: lf-infra-maven-parameters
307 # Sets an env var for shell scripts to be able to call the dynamically
308 # installed maven without having to calculate the M2_HOME themselves.
309 default: '/w/tools/hudson.tasks.Maven_MavenInstallation/{mvn-version}'
310 description: 'Maven selector to be used by shell scripts'
313 default: '{mvn-opts}'
315 Maven Java opts. Example: -Xmx1024m -XX:MaxPermSize=256m
318 default: '{mvn-params}'
320 Maven parameters to pass to the mvn command.
323 # Sets an env var for shell scripts to be able to call the dynamically
324 # installed maven without having to calculate the path themselves.
325 # yamllint disable-line rule:line-length
326 default: '/w/tools/hudson.tasks.Maven_MavenInstallation/{mvn-version}/bin/mvn'
327 description: 'Maven selector to be used by shell scripts'
330 name: lf-infra-openstack-parameters
334 default: '{os-cloud}'
336 The name of a cloud configuration in clouds.yaml. OS_CLOUD is a
337 variable name that is significant to openstack client as a
338 environment variable. Please refer to the documentation for
340 https://docs.openstack.org/developer/python-openstackclient/
344 name: lf-infra-parameters
345 # Standard parameters used in the LF CI environments. Gerrit variables are
346 # not used by GitHub projects, but defining them isn't harmful.
352 Parameter to identify a SCM project to build. This is typically
353 the project repo path. For example: ofextensions/circuitsw
358 Stream is often set to the same name as 'branch' but can
359 sometimes be used as a name representing a project's release code
365 Gerrit Trigger provided parameter to identify Gerrit project that
366 triggered the build. This is typically the project repo path as
367 exists in Gerrit. For example: ofextensions/circuitsw
369 If using Gerrit, in a manual build this should match the PROJECT
375 Gerrit Trigger provided parameter to identify a Gerrit branch.
377 If using Gerrit, in a manual build override with the branch to
381 default: 'refs/heads/{branch}'
383 Gerrit Trigger provided parameter to identify a refspec to fetch
386 If using Gerrit, in a manual build override with a refspec.
387 https://git-scm.com/book/en/v2/Git-Internals-The-Refspec
388 For example: 'refs/heads/master'
391 default: 'origin/{branch}'
393 GitHub PR Trigger provided parameter for specifying the commit
396 If using GitHub, in a manual build override with a branch path or
397 sha1 hash to a specific commit. For example: 'origin/master'
400 name: LFTOOLS_VERSION
401 default: '{lftools-version}'
403 Version of lftools to install. Can be a specific version like
404 '0.6.0' or a PEP-440 definition.
405 https://www.python.org/dev/peps/pep-0440/
406 For example '<1.0.0' or '>=1.0.0,<2.0.0'.
409 name: lf-infra-node-parameters
413 default: '{node-dir}'
414 description: Path to a Node project directory.
417 default: '{node-version}'
418 description: Version of NodeJS to install.
421 name: lf-infra-tox-parameters
427 Path to directory containing tox.ini file.
430 default: '{tox-envs}'
432 Tox environments to run build against.
433 Example: docs,py2,py3
440 name: lf-infra-properties
443 # Allow build data to be stored at a length configured by the
444 # downstream project.
445 days-to-keep: '{build-days-to-keep}'
446 # Do not allow artifacts to be stored in Jenkins.
447 artifact-num-to-keep: 0
454 name: lf-jacoco-report
457 exec-pattern: "**/**.exec"
458 class-pattern: "**/classes"
459 source-pattern: "**/src/main/java"
460 # yamllint disable-line rule:line-length
461 exclusion-pattern: "**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**"
472 name: lf-infra-publish
473 # lf-infra macro to finish up a build.
475 # Handles the following:
476 # - Shipping logs to Nexus logs site repository
477 # - Cleanup workspace
490 - lf-infra-package-listing
492 mark-unstable-if-failed: true
495 # Do not clean up *.jenkins-trigger files for jobs that use a
496 # properties file as input for triggering another build.
497 - '**/*.jenkins-trigger'
501 name: lf-stack-delete
514 echo "Deleting $STACK_NAME"
515 lftools openstack stack delete "$STACK_NAME"
516 mark-unstable-if-failed: false
523 name: lf-infra-gerrit-scm
526 credentials-id: '{jenkins-ssh-credential}'
530 - 'refs/heads/{branch}'
534 recursive: '{submodule-recursive}'
535 choosing-strategy: '{choosing-strategy}'
538 name: lf-infra-github-scm
541 credentials-id: '{jenkins-ssh-credential}'
549 recursive: '{submodule-recursive}'
550 choosing-strategy: '{choosing-strategy}'
557 name: lf-infra-wrappers
562 timeout: '{build-timeout}'
563 timeout-var: 'BUILD_TIMEOUT'
566 - ssh-agent-credentials:
568 - '{jenkins-ssh-credential}'
571 - config-file-provider:
574 target: '$HOME/.npmrc'
576 target: '$HOME/.config/pip/pip.conf'