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: "^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-maven-install
229 # Create a $HOME/.wgetrc to make the Maven download quiet.
230 - shell: 'echo "quiet=on" > "$HOME/.wgetrc"'
232 maven-version: "{mvn-version}"
234 - shell: 'rm "$HOME/.wgetrc"'
237 name: lf-provide-maven-settings
239 - config-file-provider:
241 - file-id: "{global-settings-file}"
242 variable: "GLOBAL_SETTINGS_FILE"
243 - file-id: "{settings-file}"
244 variable: "SETTINGS_FILE"
247 name: lf-provide-maven-settings-cleanup
251 set +e # DO NOT cause build failure if any of the rm calls fail.
253 rm -f "$GLOBAL_SETTINGS_FILE" "$SETTINGS_FILE"
255 # In some cases we use the lf-provide-maven-settings macro to produce
256 # a "$HOME/.netrc" file containing credentials. Remove that file here
260 # DO NOT fail build if any of the above lines fail.
264 name: lf-rtd-trigger-build
267 properties-content: |
268 RTD_BUILD_URL={rtd-build-url}
269 RTD_TOKEN={rtd-token}
270 - shell: !include-raw-escape: ../shell/rtd-trigger-build.sh
276 properties-content: |
278 PYTHON={python-version}
279 - shell: !include-raw-escape: ../shell/tox-install.sh
280 - shell: !include-raw-escape: ../shell/rtd-verify.sh
286 properties-content: |
287 DEFAULT_VERSION={default-version}
288 - shell: !include-raw-escape: ../shell/rtdv3.sh
291 name: check-info-votes
294 properties-content: JENKINS_SSH_CREDENTIAL={jenkins-ssh-credential}
295 - shell: !include-raw-escape: ../shell/check-info-votes.sh
300 - config-file-provider:
302 - file-id: lftoolsini
303 target: "$HOME/.config/lftools/lftools.ini"
304 - shell: !include-raw: ../shell/release-job.sh
307 name: lf-sigul-sign-dir
308 # Requires that Jenkins be configured with SIGUL_BRIDGE_IP as a global
309 # Environment variable
312 condition-kind: boolean-expression
313 condition-expression: "{sign-artifacts}"
315 - config-file-provider:
317 - file-id: sigul-config
318 variable: SIGUL_CONFIG
319 - file-id: sigul-password
320 variable: SIGUL_PASSWORD
323 - shell: !include-raw-escape: ../shell/sigul-configuration.sh
324 - shell: !include-raw-escape: ../shell/sigul-install.sh
326 properties-content: |
328 SIGN_MODE={sign-mode}
329 - shell: !include-raw-escape:
330 - ../shell/sigul-sign-dir.sh
331 - shell: !include-raw-escape: ../shell/sigul-configuration-cleanup.sh
334 name: lf-infra-provide-docker-cleanup
338 set +e # DO NOT cause build failure if docker rmi fails
339 docker rmi -f $(docker images -a -q)
344 # Run a Sonar Jenkins Plugin
348 scanner-name: SonarQubeScanner
350 project: "{sonar-project-file}"
351 properties: "{sonar-properties}"
352 java-opts: "{sonar-java-opts}"
353 additional-arguments: "{sonar-additional-args}"
356 name: lf-infra-sonar-with-prescan
357 # Run a Sonar Jenkins Plugin
359 - lf-sonar-prescan # Must be defined by caller
362 scanner-name: SonarQubeScanner
364 project: "{sonar-project-file}"
365 properties: "{sonar-properties}"
366 java-opts: "{sonar-java-opts}"
367 additional-arguments: "{sonar-additional-args}"
374 name: lf-clm-parameters
378 default: "{nexus-iq-stage}"
380 Stage the policy evaluation will be run against on the Nexus IQ Server.
383 name: lf-cmake-parameters
384 # Parameters useful in CMake builds.
388 default: "{build-dir}"
389 description: "Directory to build the project in."
392 default: "{cmake-opts}"
394 Options to pass to CMAKE.
395 Example: -DCMAKE_INSTALL_PREFIX=$WORKSPACE/target/output
398 default: "{install-prefix}"
399 description: "Install prefix for C/C++ builds. Example: /usr/local"
402 default: "{make-opts}"
403 description: "Options to pass to make. Example: -j8"
406 name: lf-infra-maven-parameters
410 # Sets an env var for shell scripts to be able to call the dynamically
411 # installed maven without having to calculate the M2_HOME themselves.
412 default: "/w/tools/hudson.tasks.Maven_MavenInstallation/{mvn-version}"
413 description: "Maven selector to be used by shell scripts"
416 default: "{mvn-opts}"
418 Maven Java opts. Example: -Xmx1024m -XX:MaxPermSize=256m
421 default: "{mvn-params}"
423 Maven parameters to pass to the mvn command.
426 # Sets an env var for shell scripts to be able to call the dynamically
427 # installed maven without having to calculate the path themselves.
428 # yamllint disable-line rule:line-length
429 default: "/w/tools/hudson.tasks.Maven_MavenInstallation/{mvn-version}/bin/mvn"
430 description: "Maven selector to be used by shell scripts"
433 name: lf-infra-openstack-parameters
437 default: "{os-cloud}"
439 The name of a cloud configuration in clouds.yaml. OS_CLOUD is a
440 variable name that is significant to openstack client as a
441 environment variable. Please refer to the documentation for
443 https://docs.openstack.org/developer/python-openstackclient/
446 name: lf-infra-parameters
447 # Standard parameters used in the LF CI environments. Gerrit variables are
448 # not used by GitHub projects, but defining them isn't harmful.
454 Parameter to identify a SCM project to build. This is typically
455 the project repo path. For example: ofextensions/circuitsw
460 Stream is often set to the same name as 'branch' but can
461 sometimes be used as a name representing a project's release code
467 Gerrit Trigger provided parameter to identify Gerrit project that
468 triggered the build. This is typically the project repo path as
469 exists in Gerrit. For example: ofextensions/circuitsw
471 If using Gerrit, in a manual build this should match the PROJECT
477 Gerrit Trigger provided parameter to identify a Gerrit branch.
479 If using Gerrit, in a manual build override with the branch to
483 default: "refs/heads/{branch}"
485 Gerrit Trigger provided parameter to identify a refspec to fetch
488 If using Gerrit, in a manual build override with a refspec.
489 https://git-scm.com/book/en/v2/Git-Internals-The-Refspec
490 For example: 'refs/heads/master'
493 default: "origin/{branch}"
495 GitHub PR Trigger provided parameter for specifying the commit
498 If using GitHub, in a manual build override with a branch path or
499 sha1 hash to a specific commit. For example: 'origin/master'
502 name: lf-infra-node-parameters
506 default: "{node-dir}"
507 description: Path to a Node project directory.
510 default: "{node-version}"
511 description: Version of NodeJS to install.
514 name: lf-infra-tox-parameters
520 Path to directory containing tox.ini file.
523 default: "{tox-envs}"
525 Tox environments to run build against.
526 Example: docs,py2,py3
529 name: lf-build-with-parameters-maven-release
534 description: "Version to release, for example: 1.0.0"
538 description: "Tag to push to git repo; optional, defaults to VERSION"
542 description: "Log dir, for example: project-maven-stage-master/17/"
544 name: DISTRIBUTION_TYPE
549 description: "Set to maven for build with parameters"
551 name: USE_RELEASE_FILE
552 default: "{use-release-file}"
553 description: "Set to False for job built with parameters"
560 name: lf-infra-properties
563 # Allow build data to be stored at a length configured by the
564 # downstream project.
565 days-to-keep: "{build-days-to-keep}"
566 # Do not allow artifacts to be stored in Jenkins.
567 artifact-num-to-keep: 0
574 name: lf-jacoco-report
577 exec-pattern: "**/**.exec"
578 class-pattern: "**/classes"
579 source-pattern: "**/src/main/java"
580 # yamllint disable-line rule:line-length
581 exclusion-pattern: "**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**"
592 name: lf-infra-publish
593 # lf-infra macro to finish up a build.
595 # Handles the following:
596 # - Shipping logs to Nexus logs site repository
597 # - Cleanup workspace
610 - lf-infra-package-listing
612 mark-unstable-if-failed: true
615 # Do not clean up *.jenkins-trigger files for jobs that use a
616 # properties file as input for triggering another build.
617 - "**/*.jenkins-trigger"
621 name: lf-infra-publish-windows
622 # lf-infra macro to finish up a build.
624 # Handles the following:
625 # - Shipping logs to Nexus logs site repository
626 # - Cleanup workspace
628 # TODO: RELENG-1228 Develop log shipping script for Windows systems
639 # - lf-infra-ship-logs-windows
640 # mark-unstable-if-failed: true
643 # Do not clean up *.jenkins-trigger files for jobs that use a
644 # properties file as input for triggering another build.
645 - "**/*.jenkins-trigger"
653 name: lf-infra-gerrit-scm
656 credentials-id: "{jenkins-ssh-credential}"
660 - "refs/heads/{branch}"
664 disable: "{submodule-disable}"
665 recursive: "{submodule-recursive}"
666 timeout: "{submodule-timeout}"
667 choosing-strategy: "{choosing-strategy}"
670 name: lf-infra-github-scm
673 credentials-id: "{jenkins-ssh-credential}"
681 disable: "{submodule-disable}"
682 recursive: "{submodule-recursive}"
683 timeout: "{submodule-timeout}"
684 choosing-strategy: "{choosing-strategy}"
691 name: lf-infra-wrappers-common
696 timeout: "{build-timeout}"
697 timeout-var: "BUILD_TIMEOUT"
704 name: lf-infra-wrappers
706 - lf-infra-wrappers-common:
707 build-timeout: "{build-timeout}"
708 - config-file-provider:
711 target: "$HOME/.npmrc"
713 target: "$HOME/.config/pip/pip.conf"
714 - ssh-agent-credentials:
716 - "{jenkins-ssh-credential}"
719 name: lf-infra-wrappers-windows
721 - lf-infra-wrappers-common:
722 build-timeout: "{build-timeout}"