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
278 name: check-info-votes
281 properties-content: JENKINS_SSH_CREDENTIAL={jenkins-ssh-credential}
282 - shell: !include-raw-escape: ../shell/check-info-votes.sh
287 - config-file-provider:
289 - file-id: lftoolsini
290 target: "$HOME/.config/lftools/lftools.ini"
291 - shell: !include-raw: ../shell/release-job.sh
294 name: lf-sigul-sign-dir
295 # Requires that Jenkins be configured with SIGUL_BRIDGE_IP as a global
296 # Environment variable
299 condition-kind: boolean-expression
300 condition-expression: "{sign-artifacts}"
302 - config-file-provider:
304 - file-id: sigul-config
305 variable: SIGUL_CONFIG
306 - file-id: sigul-password
307 variable: SIGUL_PASSWORD
310 - shell: !include-raw-escape: ../shell/sigul-configuration.sh
311 - shell: !include-raw-escape: ../shell/sigul-install.sh
313 properties-content: |
315 SIGN_MODE={sign-mode}
316 - shell: !include-raw-escape:
317 - ../shell/sigul-sign-dir.sh
318 - shell: !include-raw-escape: ../shell/sigul-configuration-cleanup.sh
321 name: lf-infra-provide-docker-cleanup
325 set +e # DO NOT cause build failure if docker rmi fails
326 docker rmi -f $(docker images -a -q)
331 # Run a Sonar Jenkins Plugin
335 scanner-name: SonarQubeScanner
337 project: "sonar-project.properties"
338 properties: "{sonar-properties}"
339 java-opts: "{sonar-java-opts}"
340 additional-arguments: "{sonar-additional-args}"
343 name: lf-infra-sonar-with-prescan
344 # Run a Sonar Jenkins Plugin
346 - lf-sonar-prescan # Must be defined by caller
349 scanner-name: SonarQubeScanner
351 project: "sonar-project.properties"
352 properties: "{sonar-properties}"
353 java-opts: "{sonar-java-opts}"
354 additional-arguments: "{sonar-additional-args}"
361 name: lf-clm-parameters
365 default: "{nexus-iq-stage}"
367 Stage the policy evaluation will be run against on the Nexus IQ Server.
370 name: lf-cmake-parameters
371 # Parameters useful in CMake builds.
375 default: "{build-dir}"
376 description: "Directory to build the project in."
379 default: "{cmake-opts}"
381 Options to pass to CMAKE.
382 Example: -DCMAKE_INSTALL_PREFIX=$WORKSPACE/target/output
385 default: "{install-prefix}"
386 description: "Install prefix for C/C++ builds. Example: /usr/local"
389 default: "{make-opts}"
390 description: "Options to pass to make. Example: -j8"
393 name: lf-infra-maven-parameters
397 # Sets an env var for shell scripts to be able to call the dynamically
398 # installed maven without having to calculate the M2_HOME themselves.
399 default: "/w/tools/hudson.tasks.Maven_MavenInstallation/{mvn-version}"
400 description: "Maven selector to be used by shell scripts"
403 default: "{mvn-opts}"
405 Maven Java opts. Example: -Xmx1024m -XX:MaxPermSize=256m
408 default: "{mvn-params}"
410 Maven parameters to pass to the mvn command.
413 # Sets an env var for shell scripts to be able to call the dynamically
414 # installed maven without having to calculate the path themselves.
415 # yamllint disable-line rule:line-length
416 default: "/w/tools/hudson.tasks.Maven_MavenInstallation/{mvn-version}/bin/mvn"
417 description: "Maven selector to be used by shell scripts"
420 name: lf-infra-openstack-parameters
424 default: "{os-cloud}"
426 The name of a cloud configuration in clouds.yaml. OS_CLOUD is a
427 variable name that is significant to openstack client as a
428 environment variable. Please refer to the documentation for
430 https://docs.openstack.org/developer/python-openstackclient/
433 name: lf-infra-parameters
434 # Standard parameters used in the LF CI environments. Gerrit variables are
435 # not used by GitHub projects, but defining them isn't harmful.
441 Parameter to identify a SCM project to build. This is typically
442 the project repo path. For example: ofextensions/circuitsw
447 Stream is often set to the same name as 'branch' but can
448 sometimes be used as a name representing a project's release code
454 Gerrit Trigger provided parameter to identify Gerrit project that
455 triggered the build. This is typically the project repo path as
456 exists in Gerrit. For example: ofextensions/circuitsw
458 If using Gerrit, in a manual build this should match the PROJECT
464 Gerrit Trigger provided parameter to identify a Gerrit branch.
466 If using Gerrit, in a manual build override with the branch to
470 default: "refs/heads/{branch}"
472 Gerrit Trigger provided parameter to identify a refspec to fetch
475 If using Gerrit, in a manual build override with a refspec.
476 https://git-scm.com/book/en/v2/Git-Internals-The-Refspec
477 For example: 'refs/heads/master'
480 default: "origin/{branch}"
482 GitHub PR Trigger provided parameter for specifying the commit
485 If using GitHub, in a manual build override with a branch path or
486 sha1 hash to a specific commit. For example: 'origin/master'
489 name: lf-infra-node-parameters
493 default: "{node-dir}"
494 description: Path to a Node project directory.
497 default: "{node-version}"
498 description: Version of NodeJS to install.
501 name: lf-infra-tox-parameters
507 Path to directory containing tox.ini file.
510 default: "{tox-envs}"
512 Tox environments to run build against.
513 Example: docs,py2,py3
516 name: lf-build-with-parameters-maven-release
521 description: "This is the tag, Example: 1.0.0"
525 description: "Log dir, example: project-maven-stage-master/17/"
527 name: DISTRIBUTION_TYPE
532 description: "Set to maven for build with parameters"
534 name: USE_RELEASE_FILE
535 default: "{use-release-file}"
536 description: "Set to False for job built with parameters"
543 name: lf-infra-properties
546 # Allow build data to be stored at a length configured by the
547 # downstream project.
548 days-to-keep: "{build-days-to-keep}"
549 # Do not allow artifacts to be stored in Jenkins.
550 artifact-num-to-keep: 0
557 name: lf-jacoco-report
560 exec-pattern: "**/**.exec"
561 class-pattern: "**/classes"
562 source-pattern: "**/src/main/java"
563 # yamllint disable-line rule:line-length
564 exclusion-pattern: "**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**"
575 name: lf-infra-publish
576 # lf-infra macro to finish up a build.
578 # Handles the following:
579 # - Shipping logs to Nexus logs site repository
580 # - Cleanup workspace
593 - lf-infra-package-listing
595 mark-unstable-if-failed: true
598 # Do not clean up *.jenkins-trigger files for jobs that use a
599 # properties file as input for triggering another build.
600 - "**/*.jenkins-trigger"
604 name: lf-infra-publish-windows
605 # lf-infra macro to finish up a build.
607 # Handles the following:
608 # - Shipping logs to Nexus logs site repository
609 # - Cleanup workspace
611 # TODO: RELENG-1228 Develop log shipping script for Windows systems
622 # - lf-infra-ship-logs-windows
623 # mark-unstable-if-failed: true
626 # Do not clean up *.jenkins-trigger files for jobs that use a
627 # properties file as input for triggering another build.
628 - "**/*.jenkins-trigger"
636 name: lf-infra-gerrit-scm
639 credentials-id: "{jenkins-ssh-credential}"
643 - "refs/heads/{branch}"
647 disable: "{submodule-disable}"
648 recursive: "{submodule-recursive}"
649 timeout: "{submodule-timeout}"
650 choosing-strategy: "{choosing-strategy}"
653 name: lf-infra-github-scm
656 credentials-id: "{jenkins-ssh-credential}"
664 disable: "{submodule-disable}"
665 recursive: "{submodule-recursive}"
666 timeout: "{submodule-timeout}"
667 choosing-strategy: "{choosing-strategy}"
674 name: lf-infra-wrappers-common
679 timeout: "{build-timeout}"
680 timeout-var: "BUILD_TIMEOUT"
687 name: lf-infra-wrappers
689 - lf-infra-wrappers-common:
690 build-timeout: "{build-timeout}"
691 - config-file-provider:
694 target: "$HOME/.npmrc"
696 target: "$HOME/.config/pip/pip.conf"
697 - ssh-agent-credentials:
699 - "{jenkins-ssh-credential}"
702 name: lf-infra-wrappers-windows
704 - lf-infra-wrappers-common:
705 build-timeout: "{build-timeout}"