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"
74 condition-kind: regex-match
77 on-evaluation-failure: dont-run
79 - config-file-provider:
81 - file-id: "jenkins-s3-log-ship"
82 target: $HOME/.aws/credentials
83 - lf-infra-create-netrc:
85 - shell: !include-raw:
86 # Ensure python-tools are installed in case job template does not
87 # call the lf-infra-pre-build macro.
88 - ../shell/python-tools-install.sh
89 - shell: !include-raw:
90 - ../shell/sudo-logs.sh
91 - shell: !include-raw:
92 - ../shell/job-cost.sh
93 - shell: !include-raw:
94 - ../shell/logs-deploy.sh
95 - shell: !include-raw:
96 - ../shell/logs-clear-credentials.sh
98 regexp: "(^(Nexus|S3) build logs: .*)"
101 name: lf-infra-package-listing
103 - shell: !include-raw:
104 - ../shell/package-listing.sh
107 name: lf-infra-packer-build
110 condition-kind: boolean-expression
111 condition-expression: "{openstack}"
113 - config-file-provider:
115 - file-id: clouds-yaml
116 target: "$HOME/.config/openstack/clouds.yaml"
118 properties-content: OS_CLOUD={openstack-cloud}
119 - config-file-provider:
121 - file-id: "{packer-cloud-settings}"
124 properties-content: |
125 PACKER_PLATFORM={platform}
126 PACKER_TEMPLATE={template}
127 PACKER_VERSION={packer-version}
128 UPDATE_CLOUD_IMAGE={update-cloud-image}
129 - shell: !include-raw-escape:
130 - ../shell/packer-install.sh
131 - ../shell/packer-build.sh
132 - shell: !include-raw:
133 - ../shell/packer-clear-credentials.sh
136 name: lf-infra-packer-validate
139 condition-kind: boolean-expression
140 condition-expression: "{openstack}"
142 - config-file-provider:
144 - file-id: clouds-yaml
145 target: "$HOME/.config/openstack/clouds.yaml"
147 properties-content: OS_CLOUD={openstack-cloud}
148 - config-file-provider:
150 - file-id: "{packer-cloud-settings}"
153 properties-content: |
154 PACKER_VERSION={packer-version}
155 - shell: !include-raw-escape:
156 - ../shell/packer-install.sh
157 - ../shell/packer-validate.sh
158 - shell: !include-raw:
159 - ../shell/packer-clear-credentials.sh
162 name: lf-infra-update-packer-images
164 - shell: !include-raw: ../shell/update-cloud-images.sh
167 name: lf-infra-push-gerrit-patch
170 properties-content: |
172 GERRIT_COMMIT_MESSAGE={gerrit-commit-message}
173 GERRIT_HOST={gerrit-host}
174 GERRIT_TOPIC={gerrit-topic}
175 GERRIT_USER={gerrit-user}
176 REVIEWERS_EMAIL={reviewers-email}
177 - shell: !include-raw-escape: ../shell/gerrit-push-patch.sh
180 name: lf-infra-sysstat
182 - shell: !include-raw:
183 - ../shell/sysstat.sh
186 name: lf-jacoco-nojava-workaround
188 - shell: "mkdir -p $WORKSPACE/target/classes $WORKSPACE/jacoco/classes"
191 name: lf-infra-deploy-maven-file
194 mvn-version: "{mvn-version}"
195 - lf-provide-maven-settings:
196 global-settings-file: "{global-settings-file}"
197 settings-file: "{settings-file}"
199 properties-content: |
200 MAVEN_REPO_URL={maven-repo-url}
203 UPLOAD_FILES_PATH={upload-files-dir}
204 - shell: !include-raw-escape:
205 - ../shell/common-variables.sh
206 - ../shell/deploy-maven-file.sh
207 - lf-provide-maven-settings-cleanup
210 name: lf-maven-central
213 condition-kind: boolean-expression
214 condition-expression: "{mvn-central}"
216 - lf-provide-maven-settings:
217 global-settings-file: "{mvn-global-settings}"
218 settings-file: "{mvn-settings}"
219 - lf-infra-create-netrc:
222 properties-content: "OSSRH_PROFILE_ID={ossrh-profile-id}"
223 - shell: !include-raw-escape: ../shell/maven-central.sh
224 - lf-provide-maven-settings-cleanup
227 name: lf-packagecloud-file-provider
229 - config-file-provider:
231 - file-id: ".packagecloud"
232 target: "$HOME/.packagecloud"
233 - config-file-provider:
235 - file-id: "packagecloud_api"
236 target: "$HOME/packagecloud_api"
239 name: lf-packagecloud-push
242 properties-content: |
243 BUILD_DIR={build-dir}
244 PACKAGECLOUD_ACCOUNT={packagecloud-account}
245 PACKAGECLOUD_REPO={packagecloud-repo}
246 DEBIAN_DISTRIBUTION_VERSIONS={debian-distribution-versions}
247 RPM_DISTRIBUTION_VERSIONS={rpm-distribution-versions}
248 - shell: !include-raw-escape: ../shell/packagecloud-push.sh
251 name: lf-maven-install
253 # Create a $HOME/.wgetrc to make the Maven download quiet.
254 - shell: 'echo "quiet=on" > "$HOME/.wgetrc"'
256 maven-version: "{mvn-version}"
258 - shell: 'rm "$HOME/.wgetrc"'
261 name: lf-provide-maven-settings
263 - config-file-provider:
265 - file-id: "{global-settings-file}"
266 variable: "GLOBAL_SETTINGS_FILE"
267 - file-id: "{settings-file}"
268 variable: "SETTINGS_FILE"
271 name: lf-provide-maven-settings-cleanup
275 set +e # DO NOT cause build failure if any of the rm calls fail.
277 rm -f "$GLOBAL_SETTINGS_FILE" "$SETTINGS_FILE"
279 # In some cases we use the lf-provide-maven-settings macro to produce
280 # a "$HOME/.netrc" file containing credentials. Remove that file here
284 # DO NOT fail build if any of the above lines fail.
288 name: lf-rtd-trigger-build
291 properties-content: |
292 RTD_BUILD_URL={rtd-build-url}
293 RTD_TOKEN={rtd-token}
294 - shell: !include-raw-escape: ../shell/rtd-trigger-build.sh
300 properties-content: |
302 PYTHON={python-version}
303 - shell: !include-raw-escape: ../shell/tox-install.sh
304 - shell: !include-raw-escape: ../shell/rtd-verify.sh
310 properties-content: |
311 DEFAULT_VERSION={default-version}
312 - shell: !include-raw-escape: ../shell/rtdv3.sh
315 name: check-info-votes
318 properties-content: JENKINS_SSH_CREDENTIAL={jenkins-ssh-credential}
319 - shell: !include-raw-escape: ../shell/check-info-votes.sh
324 - config-file-provider:
326 - file-id: lftoolsini
327 target: "$HOME/.config/lftools/lftools.ini"
328 - shell: !include-raw: ../shell/release-job.sh
331 name: lf-sigul-sign-dir
332 # Requires that Jenkins be configured with SIGUL_BRIDGE_IP as a global
333 # Environment variable
336 condition-kind: boolean-expression
337 condition-expression: "{sign-artifacts}"
339 - config-file-provider:
341 - file-id: sigul-config
342 variable: SIGUL_CONFIG
343 - file-id: sigul-password
344 variable: SIGUL_PASSWORD
347 - shell: !include-raw-escape: ../shell/sigul-configuration.sh
348 - shell: !include-raw-escape: ../shell/sigul-install.sh
350 properties-content: |
352 SIGN_MODE={sign-mode}
353 - shell: !include-raw-escape:
354 - ../shell/sigul-sign-dir.sh
355 - shell: !include-raw-escape: ../shell/sigul-configuration-cleanup.sh
358 name: lf-infra-provide-docker-cleanup
362 set +e # DO NOT cause build failure if docker rmi fails
363 docker rmi -f $(docker images -a -q)
368 # Run a Sonar Jenkins Plugin
372 scanner-name: SonarQubeScanner
374 project: "{sonar-project-file}"
375 properties: "{sonar-properties}"
376 java-opts: "{sonar-java-opts}"
377 additional-arguments: "{sonar-additional-args}"
380 name: lf-infra-sonar-with-prescan
381 # Run a Sonar Jenkins Plugin
383 - lf-sonar-prescan # Must be defined by caller
386 scanner-name: SonarQubeScanner
388 project: "{sonar-project-file}"
389 properties: "{sonar-properties}"
390 java-opts: "{sonar-java-opts}"
391 additional-arguments: "{sonar-additional-args}"
398 name: lf-autotools-parameters
399 # Parameters for configure-make builds.
403 default: "{configure-opts}"
405 Options to pass to configure.
406 Example: --build=i686-pc-linux-gnu
409 default: "{install-prefix}"
411 Install prefix for configure.
412 Usually a workspace subdirectory.
415 default: "{make-opts}"
417 Options to pass to make.
421 name: lf-clm-parameters
425 default: "{nexus-iq-stage}"
427 Stage the policy evaluation will be run against on the Nexus IQ Server.
430 name: lf-cmake-parameters
431 # Parameters useful in CMake builds.
435 default: "{build-dir}"
436 description: "Directory to build the project in."
439 default: "{cmake-opts}"
441 Options to pass to CMAKE.
442 Example: -DCMAKE_INSTALL_PREFIX=$WORKSPACE/target/output
445 default: "{install-prefix}"
446 description: "Install prefix for C/C++ builds. Example: /usr/local"
449 default: "{make-opts}"
450 description: "Options to pass to make. Example: -j8"
453 name: lf-infra-maven-parameters
457 # Sets an env var for shell scripts to be able to call the dynamically
458 # installed maven without having to calculate the M2_HOME themselves.
459 default: "/w/tools/hudson.tasks.Maven_MavenInstallation/{mvn-version}"
460 description: "Maven selector to be used by shell scripts"
463 default: "{mvn-opts}"
465 Maven Java opts. Example: -Xmx1024m -XX:MaxPermSize=256m
468 default: "{mvn-params}"
470 Maven parameters to pass to the mvn command.
473 # Sets an env var for shell scripts to be able to call the dynamically
474 # installed maven without having to calculate the path themselves.
475 # yamllint disable-line rule:line-length
476 default: "/w/tools/hudson.tasks.Maven_MavenInstallation/{mvn-version}/bin/mvn"
477 description: "Maven selector to be used by shell scripts"
480 name: lf-infra-openstack-parameters
484 default: "{os-cloud}"
486 The name of a cloud configuration in clouds.yaml. OS_CLOUD is a
487 variable name that is significant to openstack client as a
488 environment variable. Please refer to the documentation for
490 https://docs.openstack.org/developer/python-openstackclient/
493 name: lf-infra-parameters
494 # Standard parameters used in the LF CI environments. Gerrit variables are
495 # not used by GitHub projects, but defining them isn't harmful.
501 Parameter to identify a SCM project to build. This is typically
502 the project repo path. For example: ofextensions/circuitsw
507 Stream is often set to the same name as 'branch' but can
508 sometimes be used as a name representing a project's release code
514 Gerrit Trigger provided parameter to identify Gerrit project that
515 triggered the build. This is typically the project repo path as
516 exists in Gerrit. For example: ofextensions/circuitsw
518 If using Gerrit, in a manual build this should match the PROJECT
524 Gerrit Trigger provided parameter to identify a Gerrit branch.
526 If using Gerrit, in a manual build override with the branch to
530 default: "refs/heads/{branch}"
532 Gerrit Trigger provided parameter to identify a refspec to fetch
535 If using Gerrit, in a manual build override with a refspec.
536 https://git-scm.com/book/en/v2/Git-Internals-The-Refspec
537 For example: 'refs/heads/master'
540 default: "origin/{branch}"
542 GitHub PR Trigger provided parameter for specifying the commit
545 If using GitHub, in a manual build override with a branch path or
546 sha1 hash to a specific commit. For example: 'origin/master'
549 name: lf-infra-node-parameters
553 default: "{node-dir}"
554 description: Path to a Node project directory.
557 default: "{node-version}"
558 description: Version of NodeJS to install.
561 name: lf-infra-tox-parameters
567 Path to directory containing tox.ini file.
570 default: "{tox-envs}"
572 Tox environments to run build against.
573 Example: docs,py2,py3
576 name: lf-build-with-parameters-maven-release
581 description: "Version to release, for example: 1.0.0"
585 description: "Tag to push to git repo; optional, defaults to VERSION"
589 description: "Log dir, for example: project-maven-stage-master/17/"
591 name: DISTRIBUTION_TYPE
596 description: "Set to maven for build with parameters"
598 name: USE_RELEASE_FILE
599 default: "{use-release-file}"
600 description: "Set to False for job built with parameters"
607 name: lf-infra-properties
610 # Allow build data to be stored at a length configured by the
611 # downstream project.
612 days-to-keep: "{build-days-to-keep}"
613 # Do not allow artifacts to be stored in Jenkins.
614 artifact-num-to-keep: 0
621 name: lf-jacoco-report
624 exec-pattern: "**/**.exec"
625 class-pattern: "**/classes"
626 source-pattern: "**/src/main/java"
627 # yamllint disable-line rule:line-length
628 exclusion-pattern: "**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**"
639 name: lf-infra-publish
640 # lf-infra macro to finish up a build.
642 # Handles the following:
643 # - Shipping logs to Nexus logs site repository
644 # - Cleanup workspace
657 - lf-infra-package-listing
659 mark-unstable-if-failed: true
662 # Do not clean up *.jenkins-trigger files for jobs that use a
663 # properties file as input for triggering another build.
664 - "**/*.jenkins-trigger"
668 name: lf-infra-publish-windows
669 # lf-infra macro to finish up a build.
671 # Handles the following:
672 # - Shipping logs to Nexus logs site repository
673 # - Cleanup workspace
675 # TODO: RELENG-1228 Develop log shipping script for Windows systems
686 # - lf-infra-ship-logs-windows
687 # mark-unstable-if-failed: true
690 # Do not clean up *.jenkins-trigger files for jobs that use a
691 # properties file as input for triggering another build.
692 - "**/*.jenkins-trigger"
700 name: lf-infra-gerrit-scm
703 credentials-id: "{jenkins-ssh-credential}"
707 - "refs/heads/{branch}"
711 disable: "{submodule-disable}"
712 recursive: "{submodule-recursive}"
713 timeout: "{submodule-timeout}"
714 choosing-strategy: "{choosing-strategy}"
717 name: lf-infra-github-scm
720 credentials-id: "{jenkins-ssh-credential}"
728 disable: "{submodule-disable}"
729 recursive: "{submodule-recursive}"
730 timeout: "{submodule-timeout}"
731 choosing-strategy: "{choosing-strategy}"
738 name: lf-infra-wrappers-common
743 timeout: "{build-timeout}"
744 timeout-var: "BUILD_TIMEOUT"
751 name: lf-infra-wrappers
753 - lf-infra-wrappers-common:
754 build-timeout: "{build-timeout}"
755 - config-file-provider:
758 target: "$HOME/.npmrc"
760 target: "$HOME/.config/pip/pip.conf"
761 - ssh-agent-credentials:
763 - "{jenkins-ssh-credential}"
766 name: lf-infra-wrappers-windows
768 - lf-infra-wrappers-common:
769 build-timeout: "{build-timeout}"