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/logs-deploy.sh
83 - shell: !include-raw:
84 - ../shell/logs-clear-credentials.sh
86 regexp: "^Build logs: .*"
89 name: lf-infra-package-listing
91 - shell: !include-raw:
92 - ../shell/package-listing.sh
95 name: lf-infra-packer-build
98 condition-kind: boolean-expression
99 condition-expression: "{openstack}"
101 - config-file-provider:
103 - file-id: clouds-yaml
104 target: "$HOME/.config/openstack/clouds.yaml"
106 properties-content: OS_CLOUD={openstack-cloud}
107 - config-file-provider:
109 - file-id: "{packer-cloud-settings}"
112 properties-content: |
113 PACKER_PLATFORM={platform}
114 PACKER_TEMPLATE={template}
115 PACKER_VERSION={packer-version}
116 UPDATE_CLOUD_IMAGE={update-cloud-image}
117 - shell: !include-raw-escape:
118 - ../shell/packer-install.sh
119 - ../shell/packer-build.sh
120 - shell: !include-raw:
121 - ../shell/packer-clear-credentials.sh
124 name: lf-infra-packer-validate
127 condition-kind: boolean-expression
128 condition-expression: "{openstack}"
130 - config-file-provider:
132 - file-id: clouds-yaml
133 target: "$HOME/.config/openstack/clouds.yaml"
135 properties-content: OS_CLOUD={openstack-cloud}
136 - config-file-provider:
138 - file-id: "{packer-cloud-settings}"
141 properties-content: |
142 PACKER_VERSION={packer-version}
143 - shell: !include-raw-escape:
144 - ../shell/packer-install.sh
145 - ../shell/packer-validate.sh
146 - shell: !include-raw:
147 - ../shell/packer-clear-credentials.sh
150 name: lf-infra-update-packer-images
152 - shell: !include-raw: ../shell/update-cloud-images.sh
155 name: lf-infra-push-gerrit-patch
158 properties-content: |
160 GERRIT_COMMIT_MESSAGE={gerrit-commit-message}
161 GERRIT_HOST={gerrit-host}
162 GERRIT_TOPIC={gerrit-topic}
163 GERRIT_USER={gerrit-user}
164 REVIEWERS_EMAIL={reviewers-email}
165 - shell: !include-raw-escape: ../shell/gerrit-push-patch.sh
168 name: lf-infra-sysstat
170 - shell: !include-raw:
171 - ../shell/sysstat.sh
174 name: lf-jacoco-nojava-workaround
176 - shell: "mkdir -p $WORKSPACE/target/classes $WORKSPACE/jacoco/classes"
179 name: lf-infra-deploy-maven-file
182 mvn-version: "{mvn-version}"
183 - lf-provide-maven-settings:
184 global-settings-file: "{global-settings-file}"
185 settings-file: "{settings-file}"
187 properties-content: |
188 MAVEN_REPO_URL={maven-repo-url}
191 UPLOAD_FILES_PATH={upload-files-dir}
192 - shell: !include-raw-escape:
193 - ../shell/common-variables.sh
194 - ../shell/deploy-maven-file.sh
195 - lf-provide-maven-settings-cleanup
198 name: lf-maven-central
201 condition-kind: boolean-expression
202 condition-expression: "{mvn-central}"
204 - lf-provide-maven-settings:
205 global-settings-file: "{mvn-global-settings}"
206 settings-file: "{mvn-settings}"
207 - lf-infra-create-netrc:
210 properties-content: "OSSRH_PROFILE_ID={ossrh-profile-id}"
211 - shell: !include-raw-escape: ../shell/maven-central.sh
212 - lf-provide-maven-settings-cleanup
215 name: lf-maven-install
217 # Create a $HOME/.wgetrc to make the Maven download quiet.
218 - shell: 'echo "quiet=on" > "$HOME/.wgetrc"'
220 maven-version: "{mvn-version}"
222 - shell: 'rm "$HOME/.wgetrc"'
225 name: lf-provide-maven-settings
227 - config-file-provider:
229 - file-id: "{global-settings-file}"
230 variable: "GLOBAL_SETTINGS_FILE"
231 - file-id: "{settings-file}"
232 variable: "SETTINGS_FILE"
238 properties-content: PIP_PACKAGES={pip-packages}
239 - shell: !include-raw-escape: ../shell/pip-install.sh
242 name: lf-provide-maven-settings-cleanup
246 set +e # DO NOT cause build failure if any of the rm calls fail.
248 rm -f "$GLOBAL_SETTINGS_FILE" "$SETTINGS_FILE"
250 # In some cases we use the lf-provide-maven-settings macro to produce
251 # a "$HOME/.netrc" file containing credentials. Remove that file here
255 # DO NOT fail build if any of the above lines fail.
259 name: lf-rtd-trigger-build
262 properties-content: |
263 RTD_BUILD_URL={rtd-build-url}
264 RTD_TOKEN={rtd-token}
265 - shell: !include-raw-escape: ../shell/rtd-trigger-build.sh
271 properties-content: |
273 PYTHON={python-version}
274 - shell: !include-raw-escape: ../shell/tox-install.sh
275 - shell: !include-raw-escape: ../shell/rtd-verify.sh
281 - lf-infra-tox-install:
282 python-version: "python3"
283 - shell: !include-raw: ../shell/tox-run.sh
284 - shell: !include-raw: ../shell/rtdv2.sh
287 name: check-info-votes
290 properties-content: JENKINS_SSH_CREDENTIAL={jenkins-ssh-credential}
291 - shell: !include-raw-escape: ../shell/check-info-votes.sh
296 - config-file-provider:
298 - file-id: lftoolsini
299 target: "$HOME/.config/lftools/lftools.ini"
300 - shell: !include-raw: ../shell/release-job.sh
303 name: lf-sigul-sign-dir
304 # Requires that Jenkins be configured with SIGUL_BRIDGE_IP as a global
305 # Environment variable
308 condition-kind: boolean-expression
309 condition-expression: "{sign-artifacts}"
311 - config-file-provider:
313 - file-id: sigul-config
314 variable: SIGUL_CONFIG
315 - file-id: sigul-password
316 variable: SIGUL_PASSWORD
319 - shell: !include-raw-escape: ../shell/sigul-configuration.sh
320 - shell: !include-raw-escape: ../shell/sigul-install.sh
322 properties-content: |
324 SIGN_MODE={sign-mode}
325 - shell: !include-raw-escape:
326 - ../shell/sigul-sign-dir.sh
327 - shell: !include-raw-escape: ../shell/sigul-configuration-cleanup.sh
330 name: lf-infra-provide-docker-cleanup
334 set +e # DO NOT cause build failure if docker rmi fails
335 docker rmi -f $(docker images -a -q)
340 # Run a Sonar Jenkins Plugin
344 scanner-name: SonarQubeScanner
346 project: "{sonar-project-file}"
347 properties: "{sonar-properties}"
348 java-opts: "{sonar-java-opts}"
349 additional-arguments: "{sonar-additional-args}"
352 name: lf-infra-sonar-with-prescan
353 # Run a Sonar Jenkins Plugin
355 - lf-sonar-prescan # Must be defined by caller
358 scanner-name: SonarQubeScanner
360 project: "{sonar-project-file}"
361 properties: "{sonar-properties}"
362 java-opts: "{sonar-java-opts}"
363 additional-arguments: "{sonar-additional-args}"
370 name: lf-clm-parameters
374 default: "{nexus-iq-stage}"
376 Stage the policy evaluation will be run against on the Nexus IQ Server.
379 name: lf-cmake-parameters
380 # Parameters useful in CMake builds.
384 default: "{build-dir}"
385 description: "Directory to build the project in."
388 default: "{cmake-opts}"
390 Options to pass to CMAKE.
391 Example: -DCMAKE_INSTALL_PREFIX=$WORKSPACE/target/output
394 default: "{install-prefix}"
395 description: "Install prefix for C/C++ builds. Example: /usr/local"
398 default: "{make-opts}"
399 description: "Options to pass to make. Example: -j8"
402 name: lf-infra-maven-parameters
406 # Sets an env var for shell scripts to be able to call the dynamically
407 # installed maven without having to calculate the M2_HOME themselves.
408 default: "/w/tools/hudson.tasks.Maven_MavenInstallation/{mvn-version}"
409 description: "Maven selector to be used by shell scripts"
412 default: "{mvn-opts}"
414 Maven Java opts. Example: -Xmx1024m -XX:MaxPermSize=256m
417 default: "{mvn-params}"
419 Maven parameters to pass to the mvn command.
422 # Sets an env var for shell scripts to be able to call the dynamically
423 # installed maven without having to calculate the path themselves.
424 # yamllint disable-line rule:line-length
425 default: "/w/tools/hudson.tasks.Maven_MavenInstallation/{mvn-version}/bin/mvn"
426 description: "Maven selector to be used by shell scripts"
429 name: lf-infra-openstack-parameters
433 default: "{os-cloud}"
435 The name of a cloud configuration in clouds.yaml. OS_CLOUD is a
436 variable name that is significant to openstack client as a
437 environment variable. Please refer to the documentation for
439 https://docs.openstack.org/developer/python-openstackclient/
442 name: lf-infra-parameters
443 # Standard parameters used in the LF CI environments. Gerrit variables are
444 # not used by GitHub projects, but defining them isn't harmful.
450 Parameter to identify a SCM project to build. This is typically
451 the project repo path. For example: ofextensions/circuitsw
456 Stream is often set to the same name as 'branch' but can
457 sometimes be used as a name representing a project's release code
463 Gerrit Trigger provided parameter to identify Gerrit project that
464 triggered the build. This is typically the project repo path as
465 exists in Gerrit. For example: ofextensions/circuitsw
467 If using Gerrit, in a manual build this should match the PROJECT
473 Gerrit Trigger provided parameter to identify a Gerrit branch.
475 If using Gerrit, in a manual build override with the branch to
479 default: "refs/heads/{branch}"
481 Gerrit Trigger provided parameter to identify a refspec to fetch
484 If using Gerrit, in a manual build override with a refspec.
485 https://git-scm.com/book/en/v2/Git-Internals-The-Refspec
486 For example: 'refs/heads/master'
489 default: "origin/{branch}"
491 GitHub PR Trigger provided parameter for specifying the commit
494 If using GitHub, in a manual build override with a branch path or
495 sha1 hash to a specific commit. For example: 'origin/master'
498 name: lf-infra-node-parameters
502 default: "{node-dir}"
503 description: Path to a Node project directory.
506 default: "{node-version}"
507 description: Version of NodeJS to install.
510 name: lf-infra-tox-parameters
516 Path to directory containing tox.ini file.
519 default: "{tox-envs}"
521 Tox environments to run build against.
522 Example: docs,py2,py3
525 name: lf-build-with-parameters-maven-release
530 description: "This is the tag, Example: 1.0.0"
534 description: "Log dir, example: project-maven-stage-master/17/"
536 name: DISTRIBUTION_TYPE
541 description: "Set to maven for build with parameters"
543 name: USE_RELEASE_FILE
544 default: "{use-release-file}"
545 description: "Set to False for job built with parameters"
552 name: lf-infra-properties
555 # Allow build data to be stored at a length configured by the
556 # downstream project.
557 days-to-keep: "{build-days-to-keep}"
558 # Do not allow artifacts to be stored in Jenkins.
559 artifact-num-to-keep: 0
566 name: lf-jacoco-report
569 exec-pattern: "**/**.exec"
570 class-pattern: "**/classes"
571 source-pattern: "**/src/main/java"
572 # yamllint disable-line rule:line-length
573 exclusion-pattern: "**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**"
584 name: lf-infra-publish
585 # lf-infra macro to finish up a build.
587 # Handles the following:
588 # - Shipping logs to Nexus logs site repository
589 # - Cleanup workspace
602 - lf-infra-package-listing
604 mark-unstable-if-failed: true
607 # Do not clean up *.jenkins-trigger files for jobs that use a
608 # properties file as input for triggering another build.
609 - "**/*.jenkins-trigger"
613 name: lf-infra-publish-windows
614 # lf-infra macro to finish up a build.
616 # Handles the following:
617 # - Shipping logs to Nexus logs site repository
618 # - Cleanup workspace
620 # TODO: RELENG-1228 Develop log shipping script for Windows systems
631 # - lf-infra-ship-logs-windows
632 # mark-unstable-if-failed: true
635 # Do not clean up *.jenkins-trigger files for jobs that use a
636 # properties file as input for triggering another build.
637 - "**/*.jenkins-trigger"
645 name: lf-infra-gerrit-scm
648 credentials-id: "{jenkins-ssh-credential}"
652 - "refs/heads/{branch}"
656 disable: "{submodule-disable}"
657 recursive: "{submodule-recursive}"
658 timeout: "{submodule-timeout}"
659 choosing-strategy: "{choosing-strategy}"
662 name: lf-infra-github-scm
665 credentials-id: "{jenkins-ssh-credential}"
673 disable: "{submodule-disable}"
674 recursive: "{submodule-recursive}"
675 timeout: "{submodule-timeout}"
676 choosing-strategy: "{choosing-strategy}"
683 name: lf-infra-wrappers-common
688 timeout: "{build-timeout}"
689 timeout-var: "BUILD_TIMEOUT"
696 name: lf-infra-wrappers
698 - lf-infra-wrappers-common:
699 build-timeout: "{build-timeout}"
700 - config-file-provider:
703 target: "$HOME/.npmrc"
705 target: "$HOME/.config/pip/pip.conf"
706 - ssh-agent-credentials:
708 - "{jenkins-ssh-credential}"
711 name: lf-infra-wrappers-windows
713 - lf-infra-wrappers-common:
714 build-timeout: "{build-timeout}"