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: check-info-votes
270 properties-content: JENKINS_SSH_CREDENTIAL={jenkins-ssh-credential}
271 - shell: !include-raw-escape: ../shell/check-info-votes.sh
274 name: lf-sigul-sign-dir
275 # Requires that Jenkins be configured with SIGUL_BRIDGE_IP as a global
276 # Environment variable
279 condition-kind: boolean-expression
280 condition-expression: '{sign-artifacts}'
282 - config-file-provider:
284 - file-id: sigul-config
285 variable: SIGUL_CONFIG
286 - file-id: sigul-password
287 variable: SIGUL_PASSWORD
290 - shell: !include-raw-escape: ../shell/sigul-configuration.sh
291 - shell: !include-raw-escape: ../shell/sigul-install.sh
293 properties-content: |
295 SIGN_MODE={sign-mode}
296 - shell: !include-raw-escape:
297 - ../shell/sigul-sign-dir.sh
298 - shell: !include-raw-escape: ../shell/sigul-configuration-cleanup.sh
301 name: lf-infra-provide-docker-cleanup
305 set +e # DO NOT cause build failure if docker rmi fails
306 docker rmi -f $(docker images -a -q)
315 name: lf-clm-parameters
319 default: '{nexus-iq-stage}'
321 Stage the policy evaluation will be run against on the Nexus IQ Server.
324 name: lf-cmake-parameters
325 # Parameters useful in CMake builds.
329 default: '{build-dir}'
330 description: 'Directory to build the project in.'
333 default: '{cmake-opts}'
335 Options to pass to CMAKE.
336 Example: -DCMAKE_INSTALL_PREFIX=$WORKSPACE/target/output
339 default: '{install-prefix}'
340 description: 'Install prefix for C/C++ builds. Example: /usr/local'
343 default: '{make-opts}'
344 description: 'Options to pass to make. Example: -j8'
347 name: lf-infra-maven-parameters
351 # Sets an env var for shell scripts to be able to call the dynamically
352 # installed maven without having to calculate the M2_HOME themselves.
353 default: '/w/tools/hudson.tasks.Maven_MavenInstallation/{mvn-version}'
354 description: 'Maven selector to be used by shell scripts'
357 default: '{mvn-opts}'
359 Maven Java opts. Example: -Xmx1024m -XX:MaxPermSize=256m
362 default: '{mvn-params}'
364 Maven parameters to pass to the mvn command.
367 # Sets an env var for shell scripts to be able to call the dynamically
368 # installed maven without having to calculate the path themselves.
369 # yamllint disable-line rule:line-length
370 default: '/w/tools/hudson.tasks.Maven_MavenInstallation/{mvn-version}/bin/mvn'
371 description: 'Maven selector to be used by shell scripts'
374 name: lf-infra-openstack-parameters
378 default: '{os-cloud}'
380 The name of a cloud configuration in clouds.yaml. OS_CLOUD is a
381 variable name that is significant to openstack client as a
382 environment variable. Please refer to the documentation for
384 https://docs.openstack.org/developer/python-openstackclient/
388 name: lf-infra-parameters
389 # Standard parameters used in the LF CI environments. Gerrit variables are
390 # not used by GitHub projects, but defining them isn't harmful.
396 Parameter to identify a SCM project to build. This is typically
397 the project repo path. For example: ofextensions/circuitsw
402 Stream is often set to the same name as 'branch' but can
403 sometimes be used as a name representing a project's release code
409 Gerrit Trigger provided parameter to identify Gerrit project that
410 triggered the build. This is typically the project repo path as
411 exists in Gerrit. For example: ofextensions/circuitsw
413 If using Gerrit, in a manual build this should match the PROJECT
419 Gerrit Trigger provided parameter to identify a Gerrit branch.
421 If using Gerrit, in a manual build override with the branch to
425 default: 'refs/heads/{branch}'
427 Gerrit Trigger provided parameter to identify a refspec to fetch
430 If using Gerrit, in a manual build override with a refspec.
431 https://git-scm.com/book/en/v2/Git-Internals-The-Refspec
432 For example: 'refs/heads/master'
435 default: 'origin/{branch}'
437 GitHub PR Trigger provided parameter for specifying the commit
440 If using GitHub, in a manual build override with a branch path or
441 sha1 hash to a specific commit. For example: 'origin/master'
444 name: lf-infra-node-parameters
448 default: '{node-dir}'
449 description: Path to a Node project directory.
452 default: '{node-version}'
453 description: Version of NodeJS to install.
456 name: lf-infra-tox-parameters
462 Path to directory containing tox.ini file.
465 default: '{tox-envs}'
467 Tox environments to run build against.
468 Example: docs,py2,py3
475 name: lf-infra-properties
478 # Allow build data to be stored at a length configured by the
479 # downstream project.
480 days-to-keep: '{build-days-to-keep}'
481 # Do not allow artifacts to be stored in Jenkins.
482 artifact-num-to-keep: 0
489 name: lf-jacoco-report
492 exec-pattern: "**/**.exec"
493 class-pattern: "**/classes"
494 source-pattern: "**/src/main/java"
495 # yamllint disable-line rule:line-length
496 exclusion-pattern: "**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**"
507 name: lf-infra-publish
508 # lf-infra macro to finish up a build.
510 # Handles the following:
511 # - Shipping logs to Nexus logs site repository
512 # - Cleanup workspace
525 - lf-infra-package-listing
527 mark-unstable-if-failed: true
530 # Do not clean up *.jenkins-trigger files for jobs that use a
531 # properties file as input for triggering another build.
532 - '**/*.jenkins-trigger'
536 name: lf-infra-publish-windows
537 # lf-infra macro to finish up a build.
539 # Handles the following:
540 # - Shipping logs to Nexus logs site repository
541 # - Cleanup workspace
543 # TODO: RELENG-1228 Develop log shipping script for Windows systems
554 # - lf-infra-ship-logs-windows
555 # mark-unstable-if-failed: true
558 # Do not clean up *.jenkins-trigger files for jobs that use a
559 # properties file as input for triggering another build.
560 - '**/*.jenkins-trigger'
568 name: lf-infra-gerrit-scm
571 credentials-id: '{jenkins-ssh-credential}'
575 - 'refs/heads/{branch}'
579 recursive: '{submodule-recursive}'
580 timeout: '{submodule-timeout}'
581 choosing-strategy: '{choosing-strategy}'
584 name: lf-infra-github-scm
587 credentials-id: '{jenkins-ssh-credential}'
595 recursive: '{submodule-recursive}'
596 timeout: '{submodule-timeout}'
597 choosing-strategy: '{choosing-strategy}'
604 name: lf-infra-wrappers-common
609 timeout: '{build-timeout}'
610 timeout-var: 'BUILD_TIMEOUT'
617 name: lf-infra-wrappers
619 - lf-infra-wrappers-common:
620 build-timeout: '{build-timeout}'
621 - config-file-provider:
624 target: '$HOME/.npmrc'
626 target: '$HOME/.config/pip/pip.conf'
627 - ssh-agent-credentials:
629 - '{jenkins-ssh-credential}'
632 name: lf-infra-wrappers-windows
634 - lf-infra-wrappers-common:
635 build-timeout: '{build-timeout}'