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/job-cost.sh
83 - shell: !include-raw:
84 - ../shell/logs-deploy.sh
85 - shell: !include-raw:
86 - ../shell/logs-clear-credentials.sh
88 regexp: "^Build logs: .*"
91 name: lf-infra-package-listing
93 - shell: !include-raw:
94 - ../shell/package-listing.sh
97 name: lf-infra-packer-build
100 condition-kind: boolean-expression
101 condition-expression: "{openstack}"
103 - config-file-provider:
105 - file-id: clouds-yaml
106 target: "$HOME/.config/openstack/clouds.yaml"
108 properties-content: OS_CLOUD={openstack-cloud}
109 - config-file-provider:
111 - file-id: "{packer-cloud-settings}"
114 properties-content: |
115 PACKER_PLATFORM={platform}
116 PACKER_TEMPLATE={template}
117 PACKER_VERSION={packer-version}
118 UPDATE_CLOUD_IMAGE={update-cloud-image}
119 - shell: !include-raw-escape:
120 - ../shell/packer-install.sh
121 - ../shell/packer-build.sh
122 - shell: !include-raw:
123 - ../shell/packer-clear-credentials.sh
126 name: lf-infra-packer-validate
129 condition-kind: boolean-expression
130 condition-expression: "{openstack}"
132 - config-file-provider:
134 - file-id: clouds-yaml
135 target: "$HOME/.config/openstack/clouds.yaml"
137 properties-content: OS_CLOUD={openstack-cloud}
138 - config-file-provider:
140 - file-id: "{packer-cloud-settings}"
143 properties-content: |
144 PACKER_VERSION={packer-version}
145 - shell: !include-raw-escape:
146 - ../shell/packer-install.sh
147 - ../shell/packer-validate.sh
148 - shell: !include-raw:
149 - ../shell/packer-clear-credentials.sh
152 name: lf-infra-update-packer-images
154 - shell: !include-raw: ../shell/update-cloud-images.sh
157 name: lf-infra-push-gerrit-patch
160 properties-content: |
162 GERRIT_COMMIT_MESSAGE={gerrit-commit-message}
163 GERRIT_HOST={gerrit-host}
164 GERRIT_TOPIC={gerrit-topic}
165 GERRIT_USER={gerrit-user}
166 REVIEWERS_EMAIL={reviewers-email}
167 - shell: !include-raw-escape: ../shell/gerrit-push-patch.sh
170 name: lf-infra-sysstat
172 - shell: !include-raw:
173 - ../shell/sysstat.sh
176 name: lf-jacoco-nojava-workaround
178 - shell: "mkdir -p $WORKSPACE/target/classes $WORKSPACE/jacoco/classes"
181 name: lf-infra-deploy-maven-file
184 mvn-version: "{mvn-version}"
185 - lf-provide-maven-settings:
186 global-settings-file: "{global-settings-file}"
187 settings-file: "{settings-file}"
189 properties-content: |
190 MAVEN_REPO_URL={maven-repo-url}
193 UPLOAD_FILES_PATH={upload-files-dir}
194 - shell: !include-raw-escape:
195 - ../shell/common-variables.sh
196 - ../shell/deploy-maven-file.sh
197 - lf-provide-maven-settings-cleanup
200 name: lf-maven-central
203 condition-kind: boolean-expression
204 condition-expression: "{mvn-central}"
206 - lf-provide-maven-settings:
207 global-settings-file: "{mvn-global-settings}"
208 settings-file: "{mvn-settings}"
209 - lf-infra-create-netrc:
212 properties-content: "OSSRH_PROFILE_ID={ossrh-profile-id}"
213 - shell: !include-raw-escape: ../shell/maven-central.sh
214 - lf-provide-maven-settings-cleanup
217 name: lf-maven-install
219 # Create a $HOME/.wgetrc to make the Maven download quiet.
220 - shell: 'echo "quiet=on" > "$HOME/.wgetrc"'
222 maven-version: "{mvn-version}"
224 - shell: 'rm "$HOME/.wgetrc"'
227 name: lf-provide-maven-settings
229 - config-file-provider:
231 - file-id: "{global-settings-file}"
232 variable: "GLOBAL_SETTINGS_FILE"
233 - file-id: "{settings-file}"
234 variable: "SETTINGS_FILE"
237 name: lf-provide-maven-settings-cleanup
241 set +e # DO NOT cause build failure if any of the rm calls fail.
243 rm -f "$GLOBAL_SETTINGS_FILE" "$SETTINGS_FILE"
245 # In some cases we use the lf-provide-maven-settings macro to produce
246 # a "$HOME/.netrc" file containing credentials. Remove that file here
250 # DO NOT fail build if any of the above lines fail.
254 name: lf-rtd-trigger-build
257 properties-content: |
258 RTD_BUILD_URL={rtd-build-url}
259 RTD_TOKEN={rtd-token}
260 - shell: !include-raw-escape: ../shell/rtd-trigger-build.sh
266 properties-content: |
268 PYTHON={python-version}
269 - shell: !include-raw-escape: ../shell/tox-install.sh
270 - shell: !include-raw-escape: ../shell/rtd-verify.sh
276 properties-content: |
277 DEFAULT_VERSION={default-version}
278 - shell: !include-raw-escape: ../shell/rtdv3.sh
281 name: check-info-votes
284 properties-content: JENKINS_SSH_CREDENTIAL={jenkins-ssh-credential}
285 - shell: !include-raw-escape: ../shell/check-info-votes.sh
290 - config-file-provider:
292 - file-id: lftoolsini
293 target: "$HOME/.config/lftools/lftools.ini"
294 - shell: !include-raw: ../shell/release-job.sh
297 name: lf-sigul-sign-dir
298 # Requires that Jenkins be configured with SIGUL_BRIDGE_IP as a global
299 # Environment variable
302 condition-kind: boolean-expression
303 condition-expression: "{sign-artifacts}"
305 - config-file-provider:
307 - file-id: sigul-config
308 variable: SIGUL_CONFIG
309 - file-id: sigul-password
310 variable: SIGUL_PASSWORD
313 - shell: !include-raw-escape: ../shell/sigul-configuration.sh
314 - shell: !include-raw-escape: ../shell/sigul-install.sh
316 properties-content: |
318 SIGN_MODE={sign-mode}
319 - shell: !include-raw-escape:
320 - ../shell/sigul-sign-dir.sh
321 - shell: !include-raw-escape: ../shell/sigul-configuration-cleanup.sh
324 name: lf-infra-provide-docker-cleanup
328 set +e # DO NOT cause build failure if docker rmi fails
329 docker rmi -f $(docker images -a -q)
334 # Run a Sonar Jenkins Plugin
338 scanner-name: SonarQubeScanner
340 project: "{sonar-project-file}"
341 properties: "{sonar-properties}"
342 java-opts: "{sonar-java-opts}"
343 additional-arguments: "{sonar-additional-args}"
346 name: lf-infra-sonar-with-prescan
347 # Run a Sonar Jenkins Plugin
349 - lf-sonar-prescan # Must be defined by caller
352 scanner-name: SonarQubeScanner
354 project: "{sonar-project-file}"
355 properties: "{sonar-properties}"
356 java-opts: "{sonar-java-opts}"
357 additional-arguments: "{sonar-additional-args}"
364 name: lf-clm-parameters
368 default: "{nexus-iq-stage}"
370 Stage the policy evaluation will be run against on the Nexus IQ Server.
373 name: lf-cmake-parameters
374 # Parameters useful in CMake builds.
378 default: "{build-dir}"
379 description: "Directory to build the project in."
382 default: "{cmake-opts}"
384 Options to pass to CMAKE.
385 Example: -DCMAKE_INSTALL_PREFIX=$WORKSPACE/target/output
388 default: "{install-prefix}"
389 description: "Install prefix for C/C++ builds. Example: /usr/local"
392 default: "{make-opts}"
393 description: "Options to pass to make. Example: -j8"
396 name: lf-infra-maven-parameters
400 # Sets an env var for shell scripts to be able to call the dynamically
401 # installed maven without having to calculate the M2_HOME themselves.
402 default: "/w/tools/hudson.tasks.Maven_MavenInstallation/{mvn-version}"
403 description: "Maven selector to be used by shell scripts"
406 default: "{mvn-opts}"
408 Maven Java opts. Example: -Xmx1024m -XX:MaxPermSize=256m
411 default: "{mvn-params}"
413 Maven parameters to pass to the mvn command.
416 # Sets an env var for shell scripts to be able to call the dynamically
417 # installed maven without having to calculate the path themselves.
418 # yamllint disable-line rule:line-length
419 default: "/w/tools/hudson.tasks.Maven_MavenInstallation/{mvn-version}/bin/mvn"
420 description: "Maven selector to be used by shell scripts"
423 name: lf-infra-openstack-parameters
427 default: "{os-cloud}"
429 The name of a cloud configuration in clouds.yaml. OS_CLOUD is a
430 variable name that is significant to openstack client as a
431 environment variable. Please refer to the documentation for
433 https://docs.openstack.org/developer/python-openstackclient/
436 name: lf-infra-parameters
437 # Standard parameters used in the LF CI environments. Gerrit variables are
438 # not used by GitHub projects, but defining them isn't harmful.
444 Parameter to identify a SCM project to build. This is typically
445 the project repo path. For example: ofextensions/circuitsw
450 Stream is often set to the same name as 'branch' but can
451 sometimes be used as a name representing a project's release code
457 Gerrit Trigger provided parameter to identify Gerrit project that
458 triggered the build. This is typically the project repo path as
459 exists in Gerrit. For example: ofextensions/circuitsw
461 If using Gerrit, in a manual build this should match the PROJECT
467 Gerrit Trigger provided parameter to identify a Gerrit branch.
469 If using Gerrit, in a manual build override with the branch to
473 default: "refs/heads/{branch}"
475 Gerrit Trigger provided parameter to identify a refspec to fetch
478 If using Gerrit, in a manual build override with a refspec.
479 https://git-scm.com/book/en/v2/Git-Internals-The-Refspec
480 For example: 'refs/heads/master'
483 default: "origin/{branch}"
485 GitHub PR Trigger provided parameter for specifying the commit
488 If using GitHub, in a manual build override with a branch path or
489 sha1 hash to a specific commit. For example: 'origin/master'
492 name: lf-infra-node-parameters
496 default: "{node-dir}"
497 description: Path to a Node project directory.
500 default: "{node-version}"
501 description: Version of NodeJS to install.
504 name: lf-infra-tox-parameters
510 Path to directory containing tox.ini file.
513 default: "{tox-envs}"
515 Tox environments to run build against.
516 Example: docs,py2,py3
519 name: lf-build-with-parameters-maven-release
524 description: "Version to release, for example: 1.0.0"
528 description: "Tag to push to git repo; optional, defaults to VERSION"
532 description: "Log dir, for example: project-maven-stage-master/17/"
534 name: DISTRIBUTION_TYPE
539 description: "Set to maven for build with parameters"
541 name: USE_RELEASE_FILE
542 default: "{use-release-file}"
543 description: "Set to False for job built with parameters"
550 name: lf-infra-properties
553 # Allow build data to be stored at a length configured by the
554 # downstream project.
555 days-to-keep: "{build-days-to-keep}"
556 # Do not allow artifacts to be stored in Jenkins.
557 artifact-num-to-keep: 0
564 name: lf-jacoco-report
567 exec-pattern: "**/**.exec"
568 class-pattern: "**/classes"
569 source-pattern: "**/src/main/java"
570 # yamllint disable-line rule:line-length
571 exclusion-pattern: "**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**"
582 name: lf-infra-publish
583 # lf-infra macro to finish up a build.
585 # Handles the following:
586 # - Shipping logs to Nexus logs site repository
587 # - Cleanup workspace
600 - lf-infra-package-listing
602 mark-unstable-if-failed: true
605 # Do not clean up *.jenkins-trigger files for jobs that use a
606 # properties file as input for triggering another build.
607 - "**/*.jenkins-trigger"
611 name: lf-infra-publish-windows
612 # lf-infra macro to finish up a build.
614 # Handles the following:
615 # - Shipping logs to Nexus logs site repository
616 # - Cleanup workspace
618 # TODO: RELENG-1228 Develop log shipping script for Windows systems
629 # - lf-infra-ship-logs-windows
630 # mark-unstable-if-failed: true
633 # Do not clean up *.jenkins-trigger files for jobs that use a
634 # properties file as input for triggering another build.
635 - "**/*.jenkins-trigger"
643 name: lf-infra-gerrit-scm
646 credentials-id: "{jenkins-ssh-credential}"
650 - "refs/heads/{branch}"
654 disable: "{submodule-disable}"
655 recursive: "{submodule-recursive}"
656 timeout: "{submodule-timeout}"
657 choosing-strategy: "{choosing-strategy}"
660 name: lf-infra-github-scm
663 credentials-id: "{jenkins-ssh-credential}"
671 disable: "{submodule-disable}"
672 recursive: "{submodule-recursive}"
673 timeout: "{submodule-timeout}"
674 choosing-strategy: "{choosing-strategy}"
681 name: lf-infra-wrappers-common
686 timeout: "{build-timeout}"
687 timeout-var: "BUILD_TIMEOUT"
694 name: lf-infra-wrappers
696 - lf-infra-wrappers-common:
697 build-timeout: "{build-timeout}"
698 - config-file-provider:
701 target: "$HOME/.npmrc"
703 target: "$HOME/.config/pip/pip.conf"
704 - ssh-agent-credentials:
706 - "{jenkins-ssh-credential}"
709 name: lf-infra-wrappers-windows
711 - lf-infra-wrappers-common:
712 build-timeout: "{build-timeout}"