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'
190 name: lf-provide-sigul-configuration
191 # Push configuration files to interact with sigul
193 - config-file-provider:
195 - file-id: sigul-config
196 variable: SIGUL_CONFIG
197 - file-id: sigul-password
198 variable: SIGUL_PASSWORD
201 - shell: !include-raw: ../shell/sigul-configuration.sh
207 properties-content: PIP_PACKAGES={pip-packages}
208 - shell: !include-raw-escape: ../shell/pip-install.sh
211 name: lf-provide-maven-settings-cleanup
215 set +e # DO NOT cause build failure if any of the rm calls fail.
217 rm -f "$GLOBAL_SETTINGS_FILE" "$SETTINGS_FILE"
219 # In some cases we use the lf-provide-maven-settings macro to produce
220 # a "$HOME/.netrc" file containing credentials. Remove that file here
224 # DO NOT fail build if any of the above lines fail.
228 name: lf-provide-sigul-configuration-cleanup
229 # Clear sigul configuration files after we're done using them
231 - shell: !include-raw: ../shell/sigul-configuration-cleanup.sh
234 name: lf-rtd-trigger-build
237 properties-content: |
238 RTD_BUILD_URL={rtd-build-url}
239 RTD_TOKEN={rtd-token}
240 - shell: !include-raw-escape: ../shell/rtd-trigger-build.sh
246 properties-content: DOC_DIR={doc-dir}
247 - shell: !include-raw-escape:
248 - ../shell/tox-install.sh
249 - ../shell/rtd-verify.sh
252 name: lf-sigul-install
253 # Requires that Jenkins be configured with SIGUL_BRIDGE_IP as a global
254 # Environment variable
256 - shell: !include-raw: ../shell/sigul-install.sh
259 name: lf-infra-provide-docker-cleanup
263 set +e # DO NOT cause build failure if docker rmi fails
264 docker rmi -f $(docker images -a -q)
273 name: lf-clm-parameters
277 default: '{nexus-iq-stage}'
279 Stage the policy evaluation will be run against on the Nexus IQ Server.
282 name: lf-cmake-parameters
283 # Parameters useful in CMake builds.
287 default: '{build-dir}'
288 description: 'Directory to build the project in.'
291 default: '{cmake-opts}'
293 Options to pass to CMAKE.
294 Example: -DCMAKE_INSTALL_PREFIX=$WORKSPACE/target/output
297 default: '{install-prefix}'
298 description: 'Install prefix for C/C++ builds. Example: /usr/local'
301 default: '{make-opts}'
302 description: 'Options to pass to make. Example: -j8'
305 name: lf-infra-maven-parameters
309 # Sets an env var for shell scripts to be able to call the dynamically
310 # installed maven without having to calculate the M2_HOME themselves.
311 default: '/w/tools/hudson.tasks.Maven_MavenInstallation/{mvn-version}'
312 description: 'Maven selector to be used by shell scripts'
315 default: '{mvn-opts}'
317 Maven Java opts. Example: -Xmx1024m -XX:MaxPermSize=256m
320 default: '{mvn-params}'
322 Maven parameters to pass to the mvn command.
325 # Sets an env var for shell scripts to be able to call the dynamically
326 # installed maven without having to calculate the path themselves.
327 # yamllint disable-line rule:line-length
328 default: '/w/tools/hudson.tasks.Maven_MavenInstallation/{mvn-version}/bin/mvn'
329 description: 'Maven selector to be used by shell scripts'
332 name: lf-infra-openstack-parameters
336 default: '{os-cloud}'
338 The name of a cloud configuration in clouds.yaml. OS_CLOUD is a
339 variable name that is significant to openstack client as a
340 environment variable. Please refer to the documentation for
342 https://docs.openstack.org/developer/python-openstackclient/
346 name: lf-infra-parameters
347 # Standard parameters used in the LF CI environments. Gerrit variables are
348 # not used by GitHub projects, but defining them isn't harmful.
354 Parameter to identify a SCM project to build. This is typically
355 the project repo path. For example: ofextensions/circuitsw
360 Stream is often set to the same name as 'branch' but can
361 sometimes be used as a name representing a project's release code
367 Gerrit Trigger provided parameter to identify Gerrit project that
368 triggered the build. This is typically the project repo path as
369 exists in Gerrit. For example: ofextensions/circuitsw
371 If using Gerrit, in a manual build this should match the PROJECT
377 Gerrit Trigger provided parameter to identify a Gerrit branch.
379 If using Gerrit, in a manual build override with the branch to
383 default: 'refs/heads/{branch}'
385 Gerrit Trigger provided parameter to identify a refspec to fetch
388 If using Gerrit, in a manual build override with a refspec.
389 https://git-scm.com/book/en/v2/Git-Internals-The-Refspec
390 For example: 'refs/heads/master'
393 default: 'origin/{branch}'
395 GitHub PR Trigger provided parameter for specifying the commit
398 If using GitHub, in a manual build override with a branch path or
399 sha1 hash to a specific commit. For example: 'origin/master'
402 name: LFTOOLS_VERSION
403 default: '{lftools-version}'
405 Version of lftools to install. Can be a specific version like
406 '0.6.0' or a PEP-440 definition.
407 https://www.python.org/dev/peps/pep-0440/
408 For example '<1.0.0' or '>=1.0.0,<2.0.0'.
411 name: lf-infra-node-parameters
415 default: '{node-dir}'
416 description: Path to a Node project directory.
419 default: '{node-version}'
420 description: Version of NodeJS to install.
423 name: lf-infra-tox-parameters
429 Path to directory containing tox.ini file.
432 default: '{tox-envs}'
434 Tox environments to run build against.
435 Example: docs,py2,py3
442 name: lf-infra-properties
445 # Allow build data to be stored at a length configured by the
446 # downstream project.
447 days-to-keep: '{build-days-to-keep}'
448 # Do not allow artifacts to be stored in Jenkins.
449 artifact-num-to-keep: 0
456 name: lf-jacoco-report
459 exec-pattern: "**/**.exec"
460 class-pattern: "**/classes"
461 source-pattern: "**/src/main/java"
462 # yamllint disable-line rule:line-length
463 exclusion-pattern: "**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**"
474 name: lf-infra-publish
475 # lf-infra macro to finish up a build.
477 # Handles the following:
478 # - Shipping logs to Nexus logs site repository
479 # - Cleanup workspace
492 - lf-infra-package-listing
494 mark-unstable-if-failed: true
497 # Do not clean up *.jenkins-trigger files for jobs that use a
498 # properties file as input for triggering another build.
499 - '**/*.jenkins-trigger'
507 name: lf-infra-gerrit-scm
510 credentials-id: '{jenkins-ssh-credential}'
514 - 'refs/heads/{branch}'
518 recursive: '{submodule-recursive}'
519 choosing-strategy: '{choosing-strategy}'
522 name: lf-infra-github-scm
525 credentials-id: '{jenkins-ssh-credential}'
533 recursive: '{submodule-recursive}'
534 choosing-strategy: '{choosing-strategy}'
541 name: lf-infra-wrappers
546 timeout: '{build-timeout}'
547 timeout-var: 'BUILD_TIMEOUT'
550 - ssh-agent-credentials:
552 - '{jenkins-ssh-credential}'
555 - config-file-provider:
558 target: '$HOME/.npmrc'
560 target: '$HOME/.config/pip/pip.conf'