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/logs-deploy.sh
81 - shell: !include-raw:
82 - ../shell/logs-clear-credentials.sh
84 regexp: "^Build logs: .*"
87 name: lf-infra-package-listing
89 - shell: !include-raw:
90 - ../shell/package-listing.sh
93 name: lf-infra-packer-build
96 condition-kind: boolean-expression
97 condition-expression: "{openstack}"
99 - config-file-provider:
101 - file-id: clouds-yaml
102 target: "$HOME/.config/openstack/clouds.yaml"
104 properties-content: OS_CLOUD={openstack-cloud}
105 - config-file-provider:
107 - file-id: "{packer-cloud-settings}"
110 properties-content: |
111 PACKER_PLATFORM={platform}
112 PACKER_TEMPLATE={template}
113 PACKER_VERSION={packer-version}
114 - shell: !include-raw-escape:
115 - ../shell/packer-install.sh
116 - ../shell/packer-build.sh
117 - shell: !include-raw:
118 - ../shell/packer-clear-credentials.sh
121 name: lf-infra-packer-validate
124 condition-kind: boolean-expression
125 condition-expression: "{openstack}"
127 - config-file-provider:
129 - file-id: clouds-yaml
130 target: "$HOME/.config/openstack/clouds.yaml"
132 properties-content: OS_CLOUD={openstack-cloud}
133 - config-file-provider:
135 - file-id: "{packer-cloud-settings}"
138 properties-content: |
139 PACKER_VERSION={packer-version}
140 - shell: !include-raw-escape:
141 - ../shell/packer-install.sh
142 - ../shell/packer-validate.sh
143 - shell: !include-raw:
144 - ../shell/packer-clear-credentials.sh
147 name: lf-infra-push-gerrit-patch
150 properties-content: |
152 GERRIT_COMMIT_MESSAGE={gerrit-commit-message}
153 GERRIT_HOST={gerrit-host}
154 GERRIT_TOPIC={gerrit-topic}
155 GERRIT_USER={gerrit-user}
156 REVIEWERS_EMAIL={reviewers-email}
157 - shell: !include-raw-escape: ../shell/gerrit-push-patch.sh
160 name: lf-infra-sysstat
162 - shell: !include-raw:
163 - ../shell/sysstat.sh
166 name: lf-jacoco-nojava-workaround
168 - shell: "mkdir -p $WORKSPACE/target/classes $WORKSPACE/jacoco/classes"
171 name: lf-infra-deploy-maven-file
174 mvn-version: "{mvn-version}"
175 - lf-provide-maven-settings:
176 global-settings-file: "{global-settings-file}"
177 settings-file: "{settings-file}"
179 properties-content: |
180 MAVEN_REPO_URL={maven-repo-url}
183 UPLOAD_FILES_PATH={upload-files-dir}
184 - shell: !include-raw-escape:
185 - ../shell/common-variables.sh
186 - ../shell/deploy-maven-file.sh
187 - lf-provide-maven-settings-cleanup
190 name: lf-maven-central
193 condition-kind: boolean-expression
194 condition-expression: "{mvn-central}"
196 - lf-provide-maven-settings:
197 global-settings-file: "{mvn-global-settings}"
198 settings-file: "{mvn-settings}"
199 - lf-infra-create-netrc:
202 properties-content: "OSSRH_PROFILE_ID={ossrh-profile-id}"
203 - shell: !include-raw-escape: ../shell/maven-central.sh
204 - lf-provide-maven-settings-cleanup
207 name: lf-maven-install
209 # Create a $HOME/.wgetrc to make the Maven download quiet.
210 - shell: 'echo "quiet=on" > "$HOME/.wgetrc"'
212 maven-version: "{mvn-version}"
214 - shell: 'rm "$HOME/.wgetrc"'
217 name: lf-provide-maven-settings
219 - config-file-provider:
221 - file-id: "{global-settings-file}"
222 variable: "GLOBAL_SETTINGS_FILE"
223 - file-id: "{settings-file}"
224 variable: "SETTINGS_FILE"
230 properties-content: PIP_PACKAGES={pip-packages}
231 - shell: !include-raw-escape: ../shell/pip-install.sh
234 name: lf-provide-maven-settings-cleanup
238 set +e # DO NOT cause build failure if any of the rm calls fail.
240 rm -f "$GLOBAL_SETTINGS_FILE" "$SETTINGS_FILE"
242 # In some cases we use the lf-provide-maven-settings macro to produce
243 # a "$HOME/.netrc" file containing credentials. Remove that file here
247 # DO NOT fail build if any of the above lines fail.
251 name: lf-rtd-trigger-build
254 properties-content: |
255 RTD_BUILD_URL={rtd-build-url}
256 RTD_TOKEN={rtd-token}
257 - shell: !include-raw-escape: ../shell/rtd-trigger-build.sh
263 properties-content: |
265 PYTHON={python-version}
266 - shell: !include-raw-escape: ../shell/tox-install.sh
267 - shell: !include-raw-escape: ../shell/rtd-verify.sh
270 name: check-info-votes
273 properties-content: JENKINS_SSH_CREDENTIAL={jenkins-ssh-credential}
274 - shell: !include-raw-escape: ../shell/check-info-votes.sh
279 - config-file-provider:
281 - file-id: lftoolsini
282 target: "$HOME/.config/lftools/lftools.ini"
283 - shell: !include-raw: ../shell/release-job.sh
286 name: lf-sigul-sign-dir
287 # Requires that Jenkins be configured with SIGUL_BRIDGE_IP as a global
288 # Environment variable
291 condition-kind: boolean-expression
292 condition-expression: "{sign-artifacts}"
294 - config-file-provider:
296 - file-id: sigul-config
297 variable: SIGUL_CONFIG
298 - file-id: sigul-password
299 variable: SIGUL_PASSWORD
302 - shell: !include-raw-escape: ../shell/sigul-configuration.sh
303 - shell: !include-raw-escape: ../shell/sigul-install.sh
305 properties-content: |
307 SIGN_MODE={sign-mode}
308 - shell: !include-raw-escape:
309 - ../shell/sigul-sign-dir.sh
310 - shell: !include-raw-escape: ../shell/sigul-configuration-cleanup.sh
313 name: lf-infra-provide-docker-cleanup
317 set +e # DO NOT cause build failure if docker rmi fails
318 docker rmi -f $(docker images -a -q)
323 # Run a Sonar Jenkins Plugin
327 scanner-name: SonarQubeScanner
329 project: "sonar-project.properties"
330 properties: "{sonar-properties}"
331 java-opts: "{sonar-java-opts}"
332 additional-arguments: "{sonar-additional-args}"
339 name: lf-clm-parameters
343 default: "{nexus-iq-stage}"
345 Stage the policy evaluation will be run against on the Nexus IQ Server.
348 name: lf-cmake-parameters
349 # Parameters useful in CMake builds.
353 default: "{build-dir}"
354 description: "Directory to build the project in."
357 default: "{cmake-opts}"
359 Options to pass to CMAKE.
360 Example: -DCMAKE_INSTALL_PREFIX=$WORKSPACE/target/output
363 default: "{install-prefix}"
364 description: "Install prefix for C/C++ builds. Example: /usr/local"
367 default: "{make-opts}"
368 description: "Options to pass to make. Example: -j8"
371 name: lf-infra-maven-parameters
375 # Sets an env var for shell scripts to be able to call the dynamically
376 # installed maven without having to calculate the M2_HOME themselves.
377 default: "/w/tools/hudson.tasks.Maven_MavenInstallation/{mvn-version}"
378 description: "Maven selector to be used by shell scripts"
381 default: "{mvn-opts}"
383 Maven Java opts. Example: -Xmx1024m -XX:MaxPermSize=256m
386 default: "{mvn-params}"
388 Maven parameters to pass to the mvn command.
391 # Sets an env var for shell scripts to be able to call the dynamically
392 # installed maven without having to calculate the path themselves.
393 # yamllint disable-line rule:line-length
394 default: "/w/tools/hudson.tasks.Maven_MavenInstallation/{mvn-version}/bin/mvn"
395 description: "Maven selector to be used by shell scripts"
398 name: lf-infra-openstack-parameters
402 default: "{os-cloud}"
404 The name of a cloud configuration in clouds.yaml. OS_CLOUD is a
405 variable name that is significant to openstack client as a
406 environment variable. Please refer to the documentation for
408 https://docs.openstack.org/developer/python-openstackclient/
411 name: lf-infra-parameters
412 # Standard parameters used in the LF CI environments. Gerrit variables are
413 # not used by GitHub projects, but defining them isn't harmful.
419 Parameter to identify a SCM project to build. This is typically
420 the project repo path. For example: ofextensions/circuitsw
425 Stream is often set to the same name as 'branch' but can
426 sometimes be used as a name representing a project's release code
432 Gerrit Trigger provided parameter to identify Gerrit project that
433 triggered the build. This is typically the project repo path as
434 exists in Gerrit. For example: ofextensions/circuitsw
436 If using Gerrit, in a manual build this should match the PROJECT
442 Gerrit Trigger provided parameter to identify a Gerrit branch.
444 If using Gerrit, in a manual build override with the branch to
448 default: "refs/heads/{branch}"
450 Gerrit Trigger provided parameter to identify a refspec to fetch
453 If using Gerrit, in a manual build override with a refspec.
454 https://git-scm.com/book/en/v2/Git-Internals-The-Refspec
455 For example: 'refs/heads/master'
458 default: "origin/{branch}"
460 GitHub PR Trigger provided parameter for specifying the commit
463 If using GitHub, in a manual build override with a branch path or
464 sha1 hash to a specific commit. For example: 'origin/master'
467 name: lf-infra-node-parameters
471 default: "{node-dir}"
472 description: Path to a Node project directory.
475 default: "{node-version}"
476 description: Version of NodeJS to install.
479 name: lf-infra-tox-parameters
485 Path to directory containing tox.ini file.
488 default: "{tox-envs}"
490 Tox environments to run build against.
491 Example: docs,py2,py3
494 name: lf-build-with-parameters-maven-release
499 description: "This is the tag, Example: 1.0.0"
503 description: "Log dir, example: project-maven-stage-master/17/"
505 name: DISTRIBUTION_TYPE
507 description: "Set to maven for build with parametes"
509 name: USE_RELEASE_FILE
510 default: "{use-release-file}"
511 description: "Set to False for job built with parameters"
518 name: lf-infra-properties
521 # Allow build data to be stored at a length configured by the
522 # downstream project.
523 days-to-keep: "{build-days-to-keep}"
524 # Do not allow artifacts to be stored in Jenkins.
525 artifact-num-to-keep: 0
532 name: lf-jacoco-report
535 exec-pattern: "**/**.exec"
536 class-pattern: "**/classes"
537 source-pattern: "**/src/main/java"
538 # yamllint disable-line rule:line-length
539 exclusion-pattern: "**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**"
550 name: lf-infra-publish
551 # lf-infra macro to finish up a build.
553 # Handles the following:
554 # - Shipping logs to Nexus logs site repository
555 # - Cleanup workspace
568 - lf-infra-package-listing
570 mark-unstable-if-failed: true
573 # Do not clean up *.jenkins-trigger files for jobs that use a
574 # properties file as input for triggering another build.
575 - "**/*.jenkins-trigger"
579 name: lf-infra-publish-windows
580 # lf-infra macro to finish up a build.
582 # Handles the following:
583 # - Shipping logs to Nexus logs site repository
584 # - Cleanup workspace
586 # TODO: RELENG-1228 Develop log shipping script for Windows systems
597 # - lf-infra-ship-logs-windows
598 # mark-unstable-if-failed: true
601 # Do not clean up *.jenkins-trigger files for jobs that use a
602 # properties file as input for triggering another build.
603 - "**/*.jenkins-trigger"
611 name: lf-infra-gerrit-scm
614 credentials-id: "{jenkins-ssh-credential}"
618 - "refs/heads/{branch}"
622 disable: "{submodule-disable}"
623 recursive: "{submodule-recursive}"
624 timeout: "{submodule-timeout}"
625 choosing-strategy: "{choosing-strategy}"
628 name: lf-infra-github-scm
631 credentials-id: "{jenkins-ssh-credential}"
639 disable: "{submodule-disable}"
640 recursive: "{submodule-recursive}"
641 timeout: "{submodule-timeout}"
642 choosing-strategy: "{choosing-strategy}"
649 name: lf-infra-wrappers-common
654 timeout: "{build-timeout}"
655 timeout-var: "BUILD_TIMEOUT"
662 name: lf-infra-wrappers
664 - lf-infra-wrappers-common:
665 build-timeout: "{build-timeout}"
666 - config-file-provider:
669 target: "$HOME/.npmrc"
671 target: "$HOME/.config/pip/pip.conf"
672 - ssh-agent-credentials:
674 - "{jenkins-ssh-credential}"
677 name: lf-infra-wrappers-windows
679 - lf-infra-wrappers-common:
680 build-timeout: "{build-timeout}"