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-capture-instance-metadata
37 - shell: !include-raw:
38 - ../shell/capture-instance-metadata.sh
41 name: lf-infra-create-netrc
44 properties-content: "SERVER_ID={server-id}"
45 - shell: !include-raw-escape: ../shell/create-netrc.sh
48 name: lf-infra-docker-login
50 - lf-provide-maven-settings:
51 global-settings-file: "{global-settings-file}"
52 settings-file: "{settings-file}"
53 - shell: !include-raw-escape: ../shell/docker-login.sh
54 - lf-provide-maven-settings-cleanup
57 name: lf-infra-gpg-verify-git-signature
58 # TODO: Verify signature after downloading users public key from a locally
59 # created repository instead of the public keymesh. This requires a process
60 # in place to get ODL developers public keys into a local repository without
61 # increasing the job thoughput.
63 - shell: !include-raw: ../shell/gpg-verify-git-signature.sh
66 name: lf-infra-pre-build
68 - shell: !include-raw-escape: ../shell/python-tools-install.sh
71 name: lf-infra-ship-logs
73 # Ensure no pre-existing .netrc files are overriding logs config
74 - lf-provide-maven-settings-cleanup
75 - config-file-provider:
77 - file-id: "jenkins-log-archives-settings"
78 variable: "SETTINGS_FILE"
80 condition-kind: regex-match
83 on-evaluation-failure: dont-run
85 - config-file-provider:
87 - file-id: "jenkins-s3-log-ship"
88 target: $HOME/.aws/credentials
89 - lf-infra-create-netrc:
91 - shell: !include-raw:
92 # Ensure python-tools are installed in case job template does not
93 # call the lf-infra-pre-build macro.
94 - ../shell/python-tools-install.sh
95 - shell: !include-raw:
96 - ../shell/sudo-logs.sh
97 - shell: !include-raw:
98 - ../shell/job-cost.sh
99 - shell: !include-raw:
100 - ../shell/logs-deploy.sh
101 - shell: !include-raw:
102 - ../shell/logs-clear-credentials.sh
103 - description-setter:
104 regexp: "(^(Nexus|S3) build logs: .*)"
107 name: lf-infra-package-listing
109 - shell: !include-raw:
110 - ../shell/package-listing.sh
113 name: lf-infra-packer-build
116 condition-kind: boolean-expression
117 condition-expression: "{openstack}"
119 - config-file-provider:
121 - file-id: clouds-yaml
122 target: "$HOME/.config/openstack/clouds.yaml"
124 properties-content: OS_CLOUD={openstack-cloud}
125 - config-file-provider:
127 - file-id: "{packer-cloud-settings}"
130 properties-content: |
131 PACKER_BUILDER={packer-builder}
132 PACKER_PLATFORM={platform}
133 PACKER_TEMPLATE={template}
134 PACKER_VERSION={packer-version}
135 UPDATE_CLOUD_IMAGE={update-cloud-image}
136 - shell: !include-raw-escape:
137 - ../shell/packer-install.sh
138 - ../shell/packer-build.sh
139 - shell: !include-raw:
140 - ../shell/packer-clear-credentials.sh
143 name: lf-infra-packer-validate
146 condition-kind: boolean-expression
147 condition-expression: "{openstack}"
149 - config-file-provider:
151 - file-id: clouds-yaml
152 target: "$HOME/.config/openstack/clouds.yaml"
154 properties-content: OS_CLOUD={openstack-cloud}
155 - config-file-provider:
157 - file-id: "{packer-cloud-settings}"
160 properties-content: |
161 PACKER_VERSION={packer-version}
162 - shell: !include-raw-escape:
163 - ../shell/packer-install.sh
164 - ../shell/packer-validate.sh
165 - shell: !include-raw:
166 - ../shell/packer-clear-credentials.sh
169 name: lf-infra-update-packer-images
171 - shell: !include-raw: ../shell/update-cloud-images.sh
174 name: lf-infra-push-gerrit-patch
177 properties-content: |
179 GERRIT_COMMIT_MESSAGE={gerrit-commit-message}
180 GERRIT_HOST={gerrit-host}
181 GERRIT_TOPIC={gerrit-topic}
182 GERRIT_USER={gerrit-user}
183 REVIEWERS_EMAIL={reviewers-email}
184 - shell: !include-raw-escape: ../shell/gerrit-push-patch.sh
187 name: lf-infra-sysstat
189 - shell: !include-raw:
190 - ../shell/sysstat.sh
193 name: lf-jacoco-nojava-workaround
195 - shell: "mkdir -p $WORKSPACE/target/classes $WORKSPACE/jacoco/classes"
198 name: lf-infra-deploy-maven-file
201 mvn-version: "{mvn-version}"
202 - lf-provide-maven-settings:
203 global-settings-file: "{global-settings-file}"
204 settings-file: "{settings-file}"
206 properties-content: |
207 MAVEN_REPO_URL={maven-repo-url}
210 UPLOAD_FILES_PATH={upload-files-dir}
211 - shell: !include-raw-escape:
212 - ../shell/common-variables.sh
213 - ../shell/deploy-maven-file.sh
214 - lf-provide-maven-settings-cleanup
217 name: lf-maven-central
220 condition-kind: boolean-expression
221 condition-expression: "{mvn-central}"
223 - lf-provide-maven-settings:
224 global-settings-file: "{mvn-global-settings}"
225 settings-file: "{mvn-settings}"
226 - lf-infra-create-netrc:
229 properties-content: "OSSRH_PROFILE_ID={ossrh-profile-id}"
230 - shell: !include-raw-escape: ../shell/maven-central.sh
231 - lf-provide-maven-settings-cleanup
234 name: lf-packagecloud-file-provider
236 - config-file-provider:
238 - file-id: ".packagecloud"
239 target: "$HOME/.packagecloud"
240 - config-file-provider:
242 - file-id: "packagecloud_api"
243 target: "$HOME/packagecloud_api"
246 name: lf-packagecloud-push
249 properties-content: |
250 BUILD_DIR={build-dir}
251 PACKAGECLOUD_ACCOUNT={packagecloud-account}
252 PACKAGECLOUD_REPO={packagecloud-repo}
253 DEBIAN_DISTRIBUTION_VERSIONS={debian-distribution-versions}
254 RPM_DISTRIBUTION_VERSIONS={rpm-distribution-versions}
255 - shell: !include-raw-escape: ../shell/packagecloud-push.sh
258 name: lf-maven-install
260 # Create a $HOME/.wgetrc to make the Maven download quiet.
261 - shell: 'echo "quiet=on" > "$HOME/.wgetrc"'
263 maven-version: "{mvn-version}"
265 - shell: 'rm "$HOME/.wgetrc"'
268 name: lf-provide-maven-settings
270 - config-file-provider:
272 - file-id: "{global-settings-file}"
273 variable: "GLOBAL_SETTINGS_FILE"
274 - file-id: "{settings-file}"
275 variable: "SETTINGS_FILE"
278 name: lf-provide-maven-settings-cleanup
282 set +e # DO NOT cause build failure if any of the rm calls fail.
284 rm -f "$GLOBAL_SETTINGS_FILE" "$SETTINGS_FILE"
286 # In some cases we use the lf-provide-maven-settings macro to produce
287 # a "$HOME/.netrc" file containing credentials. Remove that file here
291 # DO NOT fail build if any of the above lines fail.
295 name: lf-rtd-trigger-build
298 properties-content: |
299 RTD_BUILD_URL={rtd-build-url}
300 RTD_TOKEN={rtd-token}
301 - shell: !include-raw-escape: ../shell/rtd-trigger-build.sh
307 properties-content: |
309 PYTHON={python-version}
310 - shell: !include-raw-escape: ../shell/tox-install.sh
311 - shell: !include-raw-escape: ../shell/rtd-verify.sh
317 properties-content: |
318 DEFAULT_VERSION={default-version}
319 - shell: !include-raw-escape: ../shell/rtdv3.sh
322 name: check-info-votes
325 properties-content: JENKINS_SSH_CREDENTIAL={jenkins-ssh-credential}
326 - shell: !include-raw-escape: ../shell/check-info-votes.sh
331 - config-file-provider:
333 - file-id: lftoolsini
334 target: "$HOME/.config/lftools/lftools.ini"
335 - shell: !include-raw: ../shell/release-job.sh
338 name: lf-sigul-sign-dir
339 # Requires that Jenkins be configured with SIGUL_BRIDGE_IP as a global
340 # Environment variable
343 condition-kind: boolean-expression
344 condition-expression: "{sign-artifacts}"
346 - config-file-provider:
348 - file-id: sigul-config
349 variable: SIGUL_CONFIG
350 - file-id: sigul-password
351 variable: SIGUL_PASSWORD
354 - shell: !include-raw-escape: ../shell/sigul-configuration.sh
355 - shell: !include-raw-escape: ../shell/sigul-install.sh
357 properties-content: |
359 SIGN_MODE={sign-mode}
360 - shell: !include-raw-escape:
361 - ../shell/sigul-sign-dir.sh
362 - shell: !include-raw-escape: ../shell/sigul-configuration-cleanup.sh
365 name: lf-infra-provide-docker-cleanup
369 set +e # DO NOT cause build failure if docker rmi fails
370 docker rmi -f $(docker images -a -q)
375 # Run a Sonar Jenkins Plugin
379 scanner-name: SonarQubeScanner
381 project: "{sonar-project-file}"
382 properties: "{sonar-properties}"
383 java-opts: "{sonar-java-opts}"
384 additional-arguments: "{sonar-additional-args}"
387 name: lf-infra-sonar-with-prescan
388 # Run a Sonar Jenkins Plugin
390 - lf-sonar-prescan # Must be defined by caller
393 scanner-name: SonarQubeScanner
395 project: "{sonar-project-file}"
396 properties: "{sonar-properties}"
397 java-opts: "{sonar-java-opts}"
398 additional-arguments: "{sonar-additional-args}"
405 name: lf-autotools-parameters
406 # Parameters for configure-make builds.
410 default: "{configure-opts}"
412 Options to pass to configure.
413 Example: --build=i686-pc-linux-gnu
416 default: "{install-prefix}"
418 Install prefix for configure.
419 Usually a workspace subdirectory.
422 default: "{make-opts}"
424 Options to pass to make.
428 name: lf-clm-parameters
432 default: "{nexus-iq-stage}"
434 Stage the policy evaluation will be run against on the Nexus IQ Server.
437 name: lf-cmake-parameters
438 # Parameters useful in CMake builds.
442 default: "{build-dir}"
443 description: "Directory to build the project in."
446 default: "{cmake-opts}"
448 Options to pass to CMAKE.
449 Example: -DCMAKE_INSTALL_PREFIX=$WORKSPACE/target/output
452 default: "{install-prefix}"
453 description: "Install prefix for C/C++ builds. Example: /usr/local"
456 default: "{make-opts}"
457 description: "Options to pass to make. Example: -j8"
460 name: lf-infra-maven-parameters
464 # Sets an env var for shell scripts to be able to call the dynamically
465 # installed maven without having to calculate the M2_HOME themselves.
466 default: "/w/tools/hudson.tasks.Maven_MavenInstallation/{mvn-version}"
467 description: "Maven selector to be used by shell scripts"
470 default: "{mvn-opts}"
472 Maven Java opts. Example: -Xmx1024m -XX:MaxPermSize=256m
475 default: "{mvn-params}"
477 Maven parameters to pass to the mvn command.
480 # Sets an env var for shell scripts to be able to call the dynamically
481 # installed maven without having to calculate the path themselves.
482 # yamllint disable-line rule:line-length
483 default: "/w/tools/hudson.tasks.Maven_MavenInstallation/{mvn-version}/bin/mvn"
484 description: "Maven selector to be used by shell scripts"
487 name: lf-infra-openstack-parameters
491 default: "{os-cloud}"
493 The name of a cloud configuration in clouds.yaml. OS_CLOUD is a
494 variable name that is significant to openstack client as a
495 environment variable. Please refer to the documentation for
497 https://docs.openstack.org/developer/python-openstackclient/
500 name: lf-infra-parameters
501 # Standard parameters used in the LF CI environments. Gerrit variables are
502 # not used by GitHub projects, but defining them isn't harmful.
508 Parameter to identify a SCM project to build. This is typically
509 the project repo path. For example: ofextensions/circuitsw
514 Stream is often set to the same name as 'branch' but can
515 sometimes be used as a name representing a project's release code
521 Gerrit Trigger provided parameter to identify Gerrit project that
522 triggered the build. This is typically the project repo path as
523 exists in Gerrit. For example: ofextensions/circuitsw
525 If using Gerrit, in a manual build this should match the PROJECT
531 Gerrit Trigger provided parameter to identify a Gerrit branch.
533 If using Gerrit, in a manual build override with the branch to
537 default: "refs/heads/{branch}"
539 Gerrit Trigger provided parameter to identify a refspec to fetch
542 If using Gerrit, in a manual build override with a refspec.
543 https://git-scm.com/book/en/v2/Git-Internals-The-Refspec
544 For example: 'refs/heads/master'
547 default: "origin/{branch}"
549 GitHub PR Trigger provided parameter for specifying the commit
552 If using GitHub, in a manual build override with a branch path or
553 sha1 hash to a specific commit. For example: 'origin/master'
556 name: lf-infra-node-parameters
560 default: "{node-dir}"
561 description: Path to a Node project directory.
564 default: "{node-version}"
565 description: Version of NodeJS to install.
568 name: lf-infra-tox-parameters
574 Path to directory containing tox.ini file.
577 default: "{tox-envs}"
579 Tox environments to run build against.
580 Example: docs,py2,py3
583 name: lf-build-with-parameters-maven-release
588 description: "Version to release, for example: 1.0.0"
592 description: "Tag to push to git repo; optional, defaults to VERSION"
596 description: "Log dir, for example: project-maven-stage-master/17/"
598 name: DISTRIBUTION_TYPE
603 description: "Set to maven for build with parameters"
605 name: USE_RELEASE_FILE
606 default: "{use-release-file}"
607 description: "Set to False for job built with parameters"
614 name: lf-infra-properties
617 # Allow build data to be stored at a length configured by the
618 # downstream project.
619 days-to-keep: "{build-days-to-keep}"
620 # Do not allow artifacts to be stored in Jenkins.
621 artifact-num-to-keep: 0
628 name: lf-jacoco-report
631 exec-pattern: "**/**.exec"
632 class-pattern: "**/classes"
633 source-pattern: "**/src/main/java"
634 # yamllint disable-line rule:line-length
635 exclusion-pattern: "**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**"
646 name: lf-infra-publish
647 # lf-infra macro to finish up a build.
649 # Handles the following:
650 # - Shipping logs to Nexus logs site repository
651 # - Cleanup workspace
664 - lf-infra-package-listing
665 - lf-infra-capture-instance-metadata
667 mark-unstable-if-failed: true
670 # Do not clean up *.jenkins-trigger files for jobs that use a
671 # properties file as input for triggering another build.
672 - "**/*.jenkins-trigger"
676 name: lf-infra-publish-windows
677 # lf-infra macro to finish up a build.
679 # Handles the following:
680 # - Shipping logs to Nexus logs site repository
681 # - Cleanup workspace
683 # TODO: RELENG-1228 Develop log shipping script for Windows systems
694 # - lf-infra-ship-logs-windows
695 # mark-unstable-if-failed: true
698 # Do not clean up *.jenkins-trigger files for jobs that use a
699 # properties file as input for triggering another build.
700 - "**/*.jenkins-trigger"
708 name: lf-infra-gerrit-scm
711 credentials-id: "{jenkins-ssh-credential}"
715 - "refs/heads/{branch}"
719 disable: "{submodule-disable}"
720 recursive: "{submodule-recursive}"
721 timeout: "{submodule-timeout}"
722 choosing-strategy: "{choosing-strategy}"
725 name: lf-infra-github-scm
728 credentials-id: "{jenkins-ssh-credential}"
736 disable: "{submodule-disable}"
737 recursive: "{submodule-recursive}"
738 timeout: "{submodule-timeout}"
739 choosing-strategy: "{choosing-strategy}"
746 name: lf-infra-wrappers-common
751 timeout: "{build-timeout}"
752 timeout-var: "BUILD_TIMEOUT"
759 name: lf-infra-wrappers
761 - lf-infra-wrappers-common:
762 build-timeout: "{build-timeout}"
763 - config-file-provider:
766 target: "$HOME/.npmrc"
768 target: "$HOME/.config/pip/pip.conf"
769 - ssh-agent-credentials:
771 - "{jenkins-ssh-credential}"
774 name: lf-infra-wrappers-windows
776 - lf-infra-wrappers-common:
777 build-timeout: "{build-timeout}"