6 # To take advantage of this macro, have your build write
7 # out the file 'gerrit_comment.txt' with information to post
8 # back to gerrit and include this macro in the list of builders.
10 name: comment-to-gerrit
12 - shell: !include-raw ../shell/comment-to-gerrit.sh
15 name: lf-fetch-dependent-patches
17 - shell: !include-raw: ../shell/gerrit-fetch-dependencies.sh
19 properties-file: $WORKSPACE/.dependency.properties
22 name: lf-license-check
26 FILE_PATTERNS={file-patterns}
27 SPDX_DISABLE={spdx-disable}
28 LHC_VERSION={lhc-version}
29 LICENSE_EXCLUDE_PATHS={license-exclude-paths}
30 LICENSES_ALLOWED={licenses-allowed}
31 - shell: !include-raw-escape:
32 - ../shell/license-check.sh
35 name: lf-infra-create-netrc
38 properties-content: 'SERVER_ID={server-id}'
39 - shell: !include-raw-escape: ../shell/create-netrc.sh
42 name: lf-infra-docker-login
44 - lf-provide-maven-settings:
45 global-settings-file: '{global-settings-file}'
46 settings-file: '{settings-file}'
47 - shell: !include-raw-escape: ../shell/docker-login.sh
48 - lf-provide-maven-settings-cleanup
51 name: lf-infra-gpg-verify-git-signature
52 # TODO: Verify signature after downloading users public key from a locally
53 # created repository instead of the public keymesh. This requires a process
54 # in place to get ODL developers public keys into a local repository without
55 # increasing the job thoughput.
57 - shell: !include-raw: ../shell/gpg-verify-git-signature.sh
60 name: lf-infra-pre-build
62 - shell: !include-raw-escape: ../shell/python-tools-install.sh
65 name: lf-infra-ship-logs
67 # Ensure no pre-existing .netrc files are overriding logs config
68 - lf-provide-maven-settings-cleanup
69 - config-file-provider:
71 - file-id: 'jenkins-log-archives-settings'
72 variable: 'SETTINGS_FILE'
73 - lf-infra-create-netrc:
75 - shell: !include-raw:
76 # Ensure python-tools are installed in case job template does not
77 # call the lf-infra-pre-build macro.
78 - ../shell/python-tools-install.sh
79 - ../shell/logs-deploy.sh
80 - shell: !include-raw:
81 - ../shell/logs-clear-credentials.sh
83 regexp: '^Build logs: .*'
86 name: lf-infra-package-listing
88 - shell: !include-raw:
89 - ../shell/package-listing.sh
92 name: lf-infra-packer-build
95 condition-kind: boolean-expression
96 condition-expression: '{openstack}'
98 - config-file-provider:
100 - file-id: clouds-yaml
101 target: '$HOME/.config/openstack/clouds.yaml'
103 properties-content: OS_CLOUD={openstack-cloud}
104 - config-file-provider:
106 - file-id: '{packer-cloud-settings}'
109 properties-content: |
110 PACKER_PLATFORM={platform}
111 PACKER_TEMPLATE={template}
112 PACKER_VERSION={packer-version}
113 - shell: !include-raw-escape:
114 - ../shell/packer-install.sh
115 - ../shell/packer-build.sh
116 - shell: !include-raw:
117 - ../shell/packer-clear-credentials.sh
120 name: lf-infra-packer-validate
123 condition-kind: boolean-expression
124 condition-expression: '{openstack}'
126 - config-file-provider:
128 - file-id: clouds-yaml
129 target: '$HOME/.config/openstack/clouds.yaml'
131 properties-content: OS_CLOUD={openstack-cloud}
132 - config-file-provider:
134 - file-id: '{packer-cloud-settings}'
137 properties-content: |
138 PACKER_VERSION={packer-version}
139 - shell: !include-raw-escape:
140 - ../shell/packer-install.sh
141 - ../shell/packer-validate.sh
142 - shell: !include-raw:
143 - ../shell/packer-clear-credentials.sh
146 name: lf-infra-push-gerrit-patch
149 properties-content: |
151 GERRIT_COMMIT_MESSAGE={gerrit-commit-message}
152 GERRIT_HOST={gerrit-host}
153 GERRIT_TOPIC={gerrit-topic}
154 GERRIT_USER={gerrit-user}
155 REVIEWERS_EMAIL={reviewers-email}
156 - shell: !include-raw-escape: ../shell/gerrit-push-patch.sh
159 name: lf-infra-sysstat
161 - shell: !include-raw:
162 - ../shell/sysstat.sh
165 name: lf-jacoco-nojava-workaround
167 - shell: 'mkdir -p $WORKSPACE/target/classes $WORKSPACE/jacoco/classes'
170 name: lf-infra-deploy-maven-file
173 mvn-version: '{mvn-version}'
174 - lf-provide-maven-settings:
175 global-settings-file: '{global-settings-file}'
176 settings-file: '{settings-file}'
178 properties-content: |
179 MAVEN_REPO_URL={maven-repo-url}
182 UPLOAD_FILES_PATH={upload-files-dir}
183 - shell: !include-raw-escape:
184 - ../shell/common-variables.sh
185 - ../shell/deploy-maven-file.sh
186 - lf-provide-maven-settings-cleanup
189 name: lf-maven-central
192 condition-kind: boolean-expression
193 condition-expression: '{mvn-central}'
195 - lf-provide-maven-settings:
196 global-settings-file: '{mvn-global-settings}'
197 settings-file: '{mvn-settings}'
198 - lf-infra-create-netrc:
201 properties-content: 'OSSRH_PROFILE_ID={ossrh-profile-id}'
202 - shell: !include-raw-escape: ../shell/maven-central.sh
203 - lf-provide-maven-settings-cleanup
206 name: lf-maven-install
208 # Create a $HOME/.wgetrc to make the Maven download quiet.
209 - shell: 'echo "quiet=on" > "$HOME/.wgetrc"'
211 maven-version: '{mvn-version}'
213 - shell: 'rm "$HOME/.wgetrc"'
216 name: lf-provide-maven-settings
218 - config-file-provider:
220 - file-id: '{global-settings-file}'
221 variable: 'GLOBAL_SETTINGS_FILE'
222 - file-id: '{settings-file}'
223 variable: 'SETTINGS_FILE'
229 properties-content: PIP_PACKAGES={pip-packages}
230 - shell: !include-raw-escape: ../shell/pip-install.sh
233 name: lf-provide-maven-settings-cleanup
237 set +e # DO NOT cause build failure if any of the rm calls fail.
239 rm -f "$GLOBAL_SETTINGS_FILE" "$SETTINGS_FILE"
241 # In some cases we use the lf-provide-maven-settings macro to produce
242 # a "$HOME/.netrc" file containing credentials. Remove that file here
246 # DO NOT fail build if any of the above lines fail.
250 name: lf-rtd-trigger-build
253 properties-content: |
254 RTD_BUILD_URL={rtd-build-url}
255 RTD_TOKEN={rtd-token}
256 - shell: !include-raw-escape: ../shell/rtd-trigger-build.sh
262 properties-content: DOC_DIR={doc-dir}
263 - shell: !include-raw-escape: ../shell/tox-install.sh
264 - shell: !include-raw-escape: ../shell/rtd-verify.sh
267 name: lf-sigul-sign-dir
268 # Requires that Jenkins be configured with SIGUL_BRIDGE_IP as a global
269 # Environment variable
272 condition-kind: boolean-expression
273 condition-expression: '{sign-artifacts}'
275 - config-file-provider:
277 - file-id: sigul-config
278 variable: SIGUL_CONFIG
279 - file-id: sigul-password
280 variable: SIGUL_PASSWORD
283 - shell: !include-raw-escape: ../shell/sigul-configuration.sh
284 - shell: !include-raw-escape: ../shell/sigul-install.sh
286 properties-content: |
288 SIGN_MODE={sign-mode}
289 - shell: !include-raw-escape:
290 - ../shell/sigul-sign-dir.sh
291 - shell: !include-raw-escape: ../shell/sigul-configuration-cleanup.sh
294 name: lf-infra-provide-docker-cleanup
298 set +e # DO NOT cause build failure if docker rmi fails
299 docker rmi -f $(docker images -a -q)
308 name: lf-clm-parameters
312 default: '{nexus-iq-stage}'
314 Stage the policy evaluation will be run against on the Nexus IQ Server.
317 name: lf-cmake-parameters
318 # Parameters useful in CMake builds.
322 default: '{build-dir}'
323 description: 'Directory to build the project in.'
326 default: '{cmake-opts}'
328 Options to pass to CMAKE.
329 Example: -DCMAKE_INSTALL_PREFIX=$WORKSPACE/target/output
332 default: '{install-prefix}'
333 description: 'Install prefix for C/C++ builds. Example: /usr/local'
336 default: '{make-opts}'
337 description: 'Options to pass to make. Example: -j8'
340 name: lf-infra-maven-parameters
344 # Sets an env var for shell scripts to be able to call the dynamically
345 # installed maven without having to calculate the M2_HOME themselves.
346 default: '/w/tools/hudson.tasks.Maven_MavenInstallation/{mvn-version}'
347 description: 'Maven selector to be used by shell scripts'
350 default: '{mvn-opts}'
352 Maven Java opts. Example: -Xmx1024m -XX:MaxPermSize=256m
355 default: '{mvn-params}'
357 Maven parameters to pass to the mvn command.
360 # Sets an env var for shell scripts to be able to call the dynamically
361 # installed maven without having to calculate the path themselves.
362 # yamllint disable-line rule:line-length
363 default: '/w/tools/hudson.tasks.Maven_MavenInstallation/{mvn-version}/bin/mvn'
364 description: 'Maven selector to be used by shell scripts'
367 name: lf-infra-openstack-parameters
371 default: '{os-cloud}'
373 The name of a cloud configuration in clouds.yaml. OS_CLOUD is a
374 variable name that is significant to openstack client as a
375 environment variable. Please refer to the documentation for
377 https://docs.openstack.org/developer/python-openstackclient/
381 name: lf-infra-parameters
382 # Standard parameters used in the LF CI environments. Gerrit variables are
383 # not used by GitHub projects, but defining them isn't harmful.
389 Parameter to identify a SCM project to build. This is typically
390 the project repo path. For example: ofextensions/circuitsw
395 Stream is often set to the same name as 'branch' but can
396 sometimes be used as a name representing a project's release code
402 Gerrit Trigger provided parameter to identify Gerrit project that
403 triggered the build. This is typically the project repo path as
404 exists in Gerrit. For example: ofextensions/circuitsw
406 If using Gerrit, in a manual build this should match the PROJECT
412 Gerrit Trigger provided parameter to identify a Gerrit branch.
414 If using Gerrit, in a manual build override with the branch to
418 default: 'refs/heads/{branch}'
420 Gerrit Trigger provided parameter to identify a refspec to fetch
423 If using Gerrit, in a manual build override with a refspec.
424 https://git-scm.com/book/en/v2/Git-Internals-The-Refspec
425 For example: 'refs/heads/master'
428 default: 'origin/{branch}'
430 GitHub PR Trigger provided parameter for specifying the commit
433 If using GitHub, in a manual build override with a branch path or
434 sha1 hash to a specific commit. For example: 'origin/master'
437 name: lf-infra-node-parameters
441 default: '{node-dir}'
442 description: Path to a Node project directory.
445 default: '{node-version}'
446 description: Version of NodeJS to install.
449 name: lf-infra-tox-parameters
455 Path to directory containing tox.ini file.
458 default: '{tox-envs}'
460 Tox environments to run build against.
461 Example: docs,py2,py3
468 name: lf-infra-properties
471 # Allow build data to be stored at a length configured by the
472 # downstream project.
473 days-to-keep: '{build-days-to-keep}'
474 # Do not allow artifacts to be stored in Jenkins.
475 artifact-num-to-keep: 0
482 name: lf-jacoco-report
485 exec-pattern: "**/**.exec"
486 class-pattern: "**/classes"
487 source-pattern: "**/src/main/java"
488 # yamllint disable-line rule:line-length
489 exclusion-pattern: "**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**"
500 name: lf-infra-publish
501 # lf-infra macro to finish up a build.
503 # Handles the following:
504 # - Shipping logs to Nexus logs site repository
505 # - Cleanup workspace
518 - lf-infra-package-listing
520 mark-unstable-if-failed: true
523 # Do not clean up *.jenkins-trigger files for jobs that use a
524 # properties file as input for triggering another build.
525 - '**/*.jenkins-trigger'
529 name: lf-infra-publish-windows
530 # lf-infra macro to finish up a build.
532 # Handles the following:
533 # - Shipping logs to Nexus logs site repository
534 # - Cleanup workspace
536 # TODO: RELENG-1228 Develop log shipping script for Windows systems
547 # - lf-infra-ship-logs-windows
548 # mark-unstable-if-failed: true
551 # Do not clean up *.jenkins-trigger files for jobs that use a
552 # properties file as input for triggering another build.
553 - '**/*.jenkins-trigger'
561 name: lf-infra-gerrit-scm
564 credentials-id: '{jenkins-ssh-credential}'
568 - 'refs/heads/{branch}'
572 recursive: '{submodule-recursive}'
573 timeout: '{submodule-timeout}'
574 choosing-strategy: '{choosing-strategy}'
577 name: lf-infra-github-scm
580 credentials-id: '{jenkins-ssh-credential}'
588 recursive: '{submodule-recursive}'
589 timeout: '{submodule-timeout}'
590 choosing-strategy: '{choosing-strategy}'
597 name: lf-infra-wrappers-common
602 timeout: '{build-timeout}'
603 timeout-var: 'BUILD_TIMEOUT'
610 name: lf-infra-wrappers
612 - lf-infra-wrappers-common:
613 build-timeout: '{build-timeout}'
614 - config-file-provider:
617 target: '$HOME/.npmrc'
619 target: '$HOME/.config/pip/pip.conf'
620 - ssh-agent-credentials:
622 - '{jenkins-ssh-credential}'
625 name: lf-infra-wrappers-windows
627 - lf-infra-wrappers-common:
628 build-timeout: '{build-timeout}'