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: !include-raw:
80 - ../shell/sudo-logs.sh
81 - shell: !include-raw:
82 - ../shell/job-cost.sh
83 - shell: !include-raw:
84 - ../shell/logs-deploy.sh
85 - shell: !include-raw:
86 - ../shell/logs-clear-credentials.sh
88 regexp: "^Build logs: .*"
91 name: lf-infra-package-listing
93 - shell: !include-raw:
94 - ../shell/package-listing.sh
97 name: lf-infra-packer-build
100 condition-kind: boolean-expression
101 condition-expression: "{openstack}"
103 - config-file-provider:
105 - file-id: clouds-yaml
106 target: "$HOME/.config/openstack/clouds.yaml"
108 properties-content: OS_CLOUD={openstack-cloud}
109 - config-file-provider:
111 - file-id: "{packer-cloud-settings}"
114 properties-content: |
115 PACKER_PLATFORM={platform}
116 PACKER_TEMPLATE={template}
117 PACKER_VERSION={packer-version}
118 UPDATE_CLOUD_IMAGE={update-cloud-image}
119 - shell: !include-raw-escape:
120 - ../shell/packer-install.sh
121 - ../shell/packer-build.sh
122 - shell: !include-raw:
123 - ../shell/packer-clear-credentials.sh
126 name: lf-infra-packer-validate
129 condition-kind: boolean-expression
130 condition-expression: "{openstack}"
132 - config-file-provider:
134 - file-id: clouds-yaml
135 target: "$HOME/.config/openstack/clouds.yaml"
137 properties-content: OS_CLOUD={openstack-cloud}
138 - config-file-provider:
140 - file-id: "{packer-cloud-settings}"
143 properties-content: |
144 PACKER_VERSION={packer-version}
145 - shell: !include-raw-escape:
146 - ../shell/packer-install.sh
147 - ../shell/packer-validate.sh
148 - shell: !include-raw:
149 - ../shell/packer-clear-credentials.sh
152 name: lf-infra-update-packer-images
154 - shell: !include-raw: ../shell/update-cloud-images.sh
157 name: lf-infra-push-gerrit-patch
160 properties-content: |
162 GERRIT_COMMIT_MESSAGE={gerrit-commit-message}
163 GERRIT_HOST={gerrit-host}
164 GERRIT_TOPIC={gerrit-topic}
165 GERRIT_USER={gerrit-user}
166 REVIEWERS_EMAIL={reviewers-email}
167 - shell: !include-raw-escape: ../shell/gerrit-push-patch.sh
170 name: lf-infra-sysstat
172 - shell: !include-raw:
173 - ../shell/sysstat.sh
176 name: lf-jacoco-nojava-workaround
178 - shell: "mkdir -p $WORKSPACE/target/classes $WORKSPACE/jacoco/classes"
181 name: lf-infra-deploy-maven-file
184 mvn-version: "{mvn-version}"
185 - lf-provide-maven-settings:
186 global-settings-file: "{global-settings-file}"
187 settings-file: "{settings-file}"
189 properties-content: |
190 MAVEN_REPO_URL={maven-repo-url}
193 UPLOAD_FILES_PATH={upload-files-dir}
194 - shell: !include-raw-escape:
195 - ../shell/common-variables.sh
196 - ../shell/deploy-maven-file.sh
197 - lf-provide-maven-settings-cleanup
200 name: lf-maven-central
203 condition-kind: boolean-expression
204 condition-expression: "{mvn-central}"
206 - lf-provide-maven-settings:
207 global-settings-file: "{mvn-global-settings}"
208 settings-file: "{mvn-settings}"
209 - lf-infra-create-netrc:
212 properties-content: "OSSRH_PROFILE_ID={ossrh-profile-id}"
213 - shell: !include-raw-escape: ../shell/maven-central.sh
214 - lf-provide-maven-settings-cleanup
217 name: lf-maven-install
219 # Create a $HOME/.wgetrc to make the Maven download quiet.
220 - shell: 'echo "quiet=on" > "$HOME/.wgetrc"'
222 maven-version: "{mvn-version}"
224 - shell: 'rm "$HOME/.wgetrc"'
227 name: lf-provide-maven-settings
229 - config-file-provider:
231 - file-id: "{global-settings-file}"
232 variable: "GLOBAL_SETTINGS_FILE"
233 - file-id: "{settings-file}"
234 variable: "SETTINGS_FILE"
240 properties-content: PIP_PACKAGES={pip-packages}
241 - shell: !include-raw-escape: ../shell/pip-install.sh
244 name: lf-provide-maven-settings-cleanup
248 set +e # DO NOT cause build failure if any of the rm calls fail.
250 rm -f "$GLOBAL_SETTINGS_FILE" "$SETTINGS_FILE"
252 # In some cases we use the lf-provide-maven-settings macro to produce
253 # a "$HOME/.netrc" file containing credentials. Remove that file here
257 # DO NOT fail build if any of the above lines fail.
261 name: lf-rtd-trigger-build
264 properties-content: |
265 RTD_BUILD_URL={rtd-build-url}
266 RTD_TOKEN={rtd-token}
267 - shell: !include-raw-escape: ../shell/rtd-trigger-build.sh
273 properties-content: |
275 PYTHON={python-version}
276 - shell: !include-raw-escape: ../shell/tox-install.sh
277 - shell: !include-raw-escape: ../shell/rtd-verify.sh
283 properties-content: |
284 DEFAULT_VERSION={default-version}
285 - shell: !include-raw-escape: ../shell/rtdv3.sh
288 name: check-info-votes
291 properties-content: JENKINS_SSH_CREDENTIAL={jenkins-ssh-credential}
292 - shell: !include-raw-escape: ../shell/check-info-votes.sh
297 - config-file-provider:
299 - file-id: lftoolsini
300 target: "$HOME/.config/lftools/lftools.ini"
301 - shell: !include-raw: ../shell/release-job.sh
304 name: lf-sigul-sign-dir
305 # Requires that Jenkins be configured with SIGUL_BRIDGE_IP as a global
306 # Environment variable
309 condition-kind: boolean-expression
310 condition-expression: "{sign-artifacts}"
312 - config-file-provider:
314 - file-id: sigul-config
315 variable: SIGUL_CONFIG
316 - file-id: sigul-password
317 variable: SIGUL_PASSWORD
320 - shell: !include-raw-escape: ../shell/sigul-configuration.sh
321 - shell: !include-raw-escape: ../shell/sigul-install.sh
323 properties-content: |
325 SIGN_MODE={sign-mode}
326 - shell: !include-raw-escape:
327 - ../shell/sigul-sign-dir.sh
328 - shell: !include-raw-escape: ../shell/sigul-configuration-cleanup.sh
331 name: lf-infra-provide-docker-cleanup
335 set +e # DO NOT cause build failure if docker rmi fails
336 docker rmi -f $(docker images -a -q)
341 # Run a Sonar Jenkins Plugin
345 scanner-name: SonarQubeScanner
347 project: "{sonar-project-file}"
348 properties: "{sonar-properties}"
349 java-opts: "{sonar-java-opts}"
350 additional-arguments: "{sonar-additional-args}"
353 name: lf-infra-sonar-with-prescan
354 # Run a Sonar Jenkins Plugin
356 - lf-sonar-prescan # Must be defined by caller
359 scanner-name: SonarQubeScanner
361 project: "{sonar-project-file}"
362 properties: "{sonar-properties}"
363 java-opts: "{sonar-java-opts}"
364 additional-arguments: "{sonar-additional-args}"
371 name: lf-clm-parameters
375 default: "{nexus-iq-stage}"
377 Stage the policy evaluation will be run against on the Nexus IQ Server.
380 name: lf-cmake-parameters
381 # Parameters useful in CMake builds.
385 default: "{build-dir}"
386 description: "Directory to build the project in."
389 default: "{cmake-opts}"
391 Options to pass to CMAKE.
392 Example: -DCMAKE_INSTALL_PREFIX=$WORKSPACE/target/output
395 default: "{install-prefix}"
396 description: "Install prefix for C/C++ builds. Example: /usr/local"
399 default: "{make-opts}"
400 description: "Options to pass to make. Example: -j8"
403 name: lf-infra-maven-parameters
407 # Sets an env var for shell scripts to be able to call the dynamically
408 # installed maven without having to calculate the M2_HOME themselves.
409 default: "/w/tools/hudson.tasks.Maven_MavenInstallation/{mvn-version}"
410 description: "Maven selector to be used by shell scripts"
413 default: "{mvn-opts}"
415 Maven Java opts. Example: -Xmx1024m -XX:MaxPermSize=256m
418 default: "{mvn-params}"
420 Maven parameters to pass to the mvn command.
423 # Sets an env var for shell scripts to be able to call the dynamically
424 # installed maven without having to calculate the path themselves.
425 # yamllint disable-line rule:line-length
426 default: "/w/tools/hudson.tasks.Maven_MavenInstallation/{mvn-version}/bin/mvn"
427 description: "Maven selector to be used by shell scripts"
430 name: lf-infra-openstack-parameters
434 default: "{os-cloud}"
436 The name of a cloud configuration in clouds.yaml. OS_CLOUD is a
437 variable name that is significant to openstack client as a
438 environment variable. Please refer to the documentation for
440 https://docs.openstack.org/developer/python-openstackclient/
443 name: lf-infra-parameters
444 # Standard parameters used in the LF CI environments. Gerrit variables are
445 # not used by GitHub projects, but defining them isn't harmful.
451 Parameter to identify a SCM project to build. This is typically
452 the project repo path. For example: ofextensions/circuitsw
457 Stream is often set to the same name as 'branch' but can
458 sometimes be used as a name representing a project's release code
464 Gerrit Trigger provided parameter to identify Gerrit project that
465 triggered the build. This is typically the project repo path as
466 exists in Gerrit. For example: ofextensions/circuitsw
468 If using Gerrit, in a manual build this should match the PROJECT
474 Gerrit Trigger provided parameter to identify a Gerrit branch.
476 If using Gerrit, in a manual build override with the branch to
480 default: "refs/heads/{branch}"
482 Gerrit Trigger provided parameter to identify a refspec to fetch
485 If using Gerrit, in a manual build override with a refspec.
486 https://git-scm.com/book/en/v2/Git-Internals-The-Refspec
487 For example: 'refs/heads/master'
490 default: "origin/{branch}"
492 GitHub PR Trigger provided parameter for specifying the commit
495 If using GitHub, in a manual build override with a branch path or
496 sha1 hash to a specific commit. For example: 'origin/master'
499 name: lf-infra-node-parameters
503 default: "{node-dir}"
504 description: Path to a Node project directory.
507 default: "{node-version}"
508 description: Version of NodeJS to install.
511 name: lf-infra-tox-parameters
517 Path to directory containing tox.ini file.
520 default: "{tox-envs}"
522 Tox environments to run build against.
523 Example: docs,py2,py3
526 name: lf-build-with-parameters-maven-release
531 description: "Version to release, for example: 1.0.0"
535 description: "Tag to push to git repo; optional, defaults to VERSION"
539 description: "Log dir, for example: project-maven-stage-master/17/"
541 name: DISTRIBUTION_TYPE
546 description: "Set to maven for build with parameters"
548 name: USE_RELEASE_FILE
549 default: "{use-release-file}"
550 description: "Set to False for job built with parameters"
557 name: lf-infra-properties
560 # Allow build data to be stored at a length configured by the
561 # downstream project.
562 days-to-keep: "{build-days-to-keep}"
563 # Do not allow artifacts to be stored in Jenkins.
564 artifact-num-to-keep: 0
571 name: lf-jacoco-report
574 exec-pattern: "**/**.exec"
575 class-pattern: "**/classes"
576 source-pattern: "**/src/main/java"
577 # yamllint disable-line rule:line-length
578 exclusion-pattern: "**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**"
589 name: lf-infra-publish
590 # lf-infra macro to finish up a build.
592 # Handles the following:
593 # - Shipping logs to Nexus logs site repository
594 # - Cleanup workspace
607 - lf-infra-package-listing
609 mark-unstable-if-failed: true
612 # Do not clean up *.jenkins-trigger files for jobs that use a
613 # properties file as input for triggering another build.
614 - "**/*.jenkins-trigger"
618 name: lf-infra-publish-windows
619 # lf-infra macro to finish up a build.
621 # Handles the following:
622 # - Shipping logs to Nexus logs site repository
623 # - Cleanup workspace
625 # TODO: RELENG-1228 Develop log shipping script for Windows systems
636 # - lf-infra-ship-logs-windows
637 # mark-unstable-if-failed: true
640 # Do not clean up *.jenkins-trigger files for jobs that use a
641 # properties file as input for triggering another build.
642 - "**/*.jenkins-trigger"
650 name: lf-infra-gerrit-scm
653 credentials-id: "{jenkins-ssh-credential}"
657 - "refs/heads/{branch}"
661 disable: "{submodule-disable}"
662 recursive: "{submodule-recursive}"
663 timeout: "{submodule-timeout}"
664 choosing-strategy: "{choosing-strategy}"
667 name: lf-infra-github-scm
670 credentials-id: "{jenkins-ssh-credential}"
678 disable: "{submodule-disable}"
679 recursive: "{submodule-recursive}"
680 timeout: "{submodule-timeout}"
681 choosing-strategy: "{choosing-strategy}"
688 name: lf-infra-wrappers-common
693 timeout: "{build-timeout}"
694 timeout-var: "BUILD_TIMEOUT"
701 name: lf-infra-wrappers
703 - lf-infra-wrappers-common:
704 build-timeout: "{build-timeout}"
705 - config-file-provider:
708 target: "$HOME/.npmrc"
710 target: "$HOME/.config/pip/pip.conf"
711 - ssh-agent-credentials:
713 - "{jenkins-ssh-credential}"
716 name: lf-infra-wrappers-windows
718 - lf-infra-wrappers-common:
719 build-timeout: "{build-timeout}"