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 UPDATE_CLOUD_IMAGE={update-cloud-image}
115 - shell: !include-raw-escape:
116 - ../shell/packer-install.sh
117 - ../shell/packer-build.sh
118 - shell: !include-raw:
119 - ../shell/packer-clear-credentials.sh
122 name: lf-infra-packer-validate
125 condition-kind: boolean-expression
126 condition-expression: "{openstack}"
128 - config-file-provider:
130 - file-id: clouds-yaml
131 target: "$HOME/.config/openstack/clouds.yaml"
133 properties-content: OS_CLOUD={openstack-cloud}
134 - config-file-provider:
136 - file-id: "{packer-cloud-settings}"
139 properties-content: |
140 PACKER_VERSION={packer-version}
141 - shell: !include-raw-escape:
142 - ../shell/packer-install.sh
143 - ../shell/packer-validate.sh
144 - shell: !include-raw:
145 - ../shell/packer-clear-credentials.sh
148 name: lf-infra-update-packer-images
150 - shell: !include-raw: ../shell/update-cloud-images.sh
153 name: lf-infra-push-gerrit-patch
156 properties-content: |
158 GERRIT_COMMIT_MESSAGE={gerrit-commit-message}
159 GERRIT_HOST={gerrit-host}
160 GERRIT_TOPIC={gerrit-topic}
161 GERRIT_USER={gerrit-user}
162 REVIEWERS_EMAIL={reviewers-email}
163 - shell: !include-raw-escape: ../shell/gerrit-push-patch.sh
166 name: lf-infra-sysstat
168 - shell: !include-raw:
169 - ../shell/sysstat.sh
172 name: lf-jacoco-nojava-workaround
174 - shell: "mkdir -p $WORKSPACE/target/classes $WORKSPACE/jacoco/classes"
177 name: lf-infra-deploy-maven-file
180 mvn-version: "{mvn-version}"
181 - lf-provide-maven-settings:
182 global-settings-file: "{global-settings-file}"
183 settings-file: "{settings-file}"
185 properties-content: |
186 MAVEN_REPO_URL={maven-repo-url}
189 UPLOAD_FILES_PATH={upload-files-dir}
190 - shell: !include-raw-escape:
191 - ../shell/common-variables.sh
192 - ../shell/deploy-maven-file.sh
193 - lf-provide-maven-settings-cleanup
196 name: lf-maven-central
199 condition-kind: boolean-expression
200 condition-expression: "{mvn-central}"
202 - lf-provide-maven-settings:
203 global-settings-file: "{mvn-global-settings}"
204 settings-file: "{mvn-settings}"
205 - lf-infra-create-netrc:
208 properties-content: "OSSRH_PROFILE_ID={ossrh-profile-id}"
209 - shell: !include-raw-escape: ../shell/maven-central.sh
210 - lf-provide-maven-settings-cleanup
213 name: lf-maven-install
215 # Create a $HOME/.wgetrc to make the Maven download quiet.
216 - shell: 'echo "quiet=on" > "$HOME/.wgetrc"'
218 maven-version: "{mvn-version}"
220 - shell: 'rm "$HOME/.wgetrc"'
223 name: lf-provide-maven-settings
225 - config-file-provider:
227 - file-id: "{global-settings-file}"
228 variable: "GLOBAL_SETTINGS_FILE"
229 - file-id: "{settings-file}"
230 variable: "SETTINGS_FILE"
236 properties-content: PIP_PACKAGES={pip-packages}
237 - shell: !include-raw-escape: ../shell/pip-install.sh
240 name: lf-provide-maven-settings-cleanup
244 set +e # DO NOT cause build failure if any of the rm calls fail.
246 rm -f "$GLOBAL_SETTINGS_FILE" "$SETTINGS_FILE"
248 # In some cases we use the lf-provide-maven-settings macro to produce
249 # a "$HOME/.netrc" file containing credentials. Remove that file here
253 # DO NOT fail build if any of the above lines fail.
257 name: lf-rtd-trigger-build
260 properties-content: |
261 RTD_BUILD_URL={rtd-build-url}
262 RTD_TOKEN={rtd-token}
263 - shell: !include-raw-escape: ../shell/rtd-trigger-build.sh
269 properties-content: |
271 PYTHON={python-version}
272 - shell: !include-raw-escape: ../shell/tox-install.sh
273 - shell: !include-raw-escape: ../shell/rtd-verify.sh
276 name: check-info-votes
279 properties-content: JENKINS_SSH_CREDENTIAL={jenkins-ssh-credential}
280 - shell: !include-raw-escape: ../shell/check-info-votes.sh
285 - config-file-provider:
287 - file-id: lftoolsini
288 target: "$HOME/.config/lftools/lftools.ini"
289 - shell: !include-raw: ../shell/release-job.sh
292 name: lf-sigul-sign-dir
293 # Requires that Jenkins be configured with SIGUL_BRIDGE_IP as a global
294 # Environment variable
297 condition-kind: boolean-expression
298 condition-expression: "{sign-artifacts}"
300 - config-file-provider:
302 - file-id: sigul-config
303 variable: SIGUL_CONFIG
304 - file-id: sigul-password
305 variable: SIGUL_PASSWORD
308 - shell: !include-raw-escape: ../shell/sigul-configuration.sh
309 - shell: !include-raw-escape: ../shell/sigul-install.sh
311 properties-content: |
313 SIGN_MODE={sign-mode}
314 - shell: !include-raw-escape:
315 - ../shell/sigul-sign-dir.sh
316 - shell: !include-raw-escape: ../shell/sigul-configuration-cleanup.sh
319 name: lf-infra-provide-docker-cleanup
323 set +e # DO NOT cause build failure if docker rmi fails
324 docker rmi -f $(docker images -a -q)
329 # Run a Sonar Jenkins Plugin
333 scanner-name: SonarQubeScanner
335 project: "sonar-project.properties"
336 properties: "{sonar-properties}"
337 java-opts: "{sonar-java-opts}"
338 additional-arguments: "{sonar-additional-args}"
345 name: lf-clm-parameters
349 default: "{nexus-iq-stage}"
351 Stage the policy evaluation will be run against on the Nexus IQ Server.
354 name: lf-cmake-parameters
355 # Parameters useful in CMake builds.
359 default: "{build-dir}"
360 description: "Directory to build the project in."
363 default: "{cmake-opts}"
365 Options to pass to CMAKE.
366 Example: -DCMAKE_INSTALL_PREFIX=$WORKSPACE/target/output
369 default: "{install-prefix}"
370 description: "Install prefix for C/C++ builds. Example: /usr/local"
373 default: "{make-opts}"
374 description: "Options to pass to make. Example: -j8"
377 name: lf-infra-maven-parameters
381 # Sets an env var for shell scripts to be able to call the dynamically
382 # installed maven without having to calculate the M2_HOME themselves.
383 default: "/w/tools/hudson.tasks.Maven_MavenInstallation/{mvn-version}"
384 description: "Maven selector to be used by shell scripts"
387 default: "{mvn-opts}"
389 Maven Java opts. Example: -Xmx1024m -XX:MaxPermSize=256m
392 default: "{mvn-params}"
394 Maven parameters to pass to the mvn command.
397 # Sets an env var for shell scripts to be able to call the dynamically
398 # installed maven without having to calculate the path themselves.
399 # yamllint disable-line rule:line-length
400 default: "/w/tools/hudson.tasks.Maven_MavenInstallation/{mvn-version}/bin/mvn"
401 description: "Maven selector to be used by shell scripts"
404 name: lf-infra-openstack-parameters
408 default: "{os-cloud}"
410 The name of a cloud configuration in clouds.yaml. OS_CLOUD is a
411 variable name that is significant to openstack client as a
412 environment variable. Please refer to the documentation for
414 https://docs.openstack.org/developer/python-openstackclient/
417 name: lf-infra-parameters
418 # Standard parameters used in the LF CI environments. Gerrit variables are
419 # not used by GitHub projects, but defining them isn't harmful.
425 Parameter to identify a SCM project to build. This is typically
426 the project repo path. For example: ofextensions/circuitsw
431 Stream is often set to the same name as 'branch' but can
432 sometimes be used as a name representing a project's release code
438 Gerrit Trigger provided parameter to identify Gerrit project that
439 triggered the build. This is typically the project repo path as
440 exists in Gerrit. For example: ofextensions/circuitsw
442 If using Gerrit, in a manual build this should match the PROJECT
448 Gerrit Trigger provided parameter to identify a Gerrit branch.
450 If using Gerrit, in a manual build override with the branch to
454 default: "refs/heads/{branch}"
456 Gerrit Trigger provided parameter to identify a refspec to fetch
459 If using Gerrit, in a manual build override with a refspec.
460 https://git-scm.com/book/en/v2/Git-Internals-The-Refspec
461 For example: 'refs/heads/master'
464 default: "origin/{branch}"
466 GitHub PR Trigger provided parameter for specifying the commit
469 If using GitHub, in a manual build override with a branch path or
470 sha1 hash to a specific commit. For example: 'origin/master'
473 name: lf-infra-node-parameters
477 default: "{node-dir}"
478 description: Path to a Node project directory.
481 default: "{node-version}"
482 description: Version of NodeJS to install.
485 name: lf-infra-tox-parameters
491 Path to directory containing tox.ini file.
494 default: "{tox-envs}"
496 Tox environments to run build against.
497 Example: docs,py2,py3
500 name: lf-build-with-parameters-maven-release
505 description: "This is the tag, Example: 1.0.0"
509 description: "Log dir, example: project-maven-stage-master/17/"
511 name: DISTRIBUTION_TYPE
513 description: "Set to maven for build with parametes"
515 name: USE_RELEASE_FILE
516 default: "{use-release-file}"
517 description: "Set to False for job built with parameters"
524 name: lf-infra-properties
527 # Allow build data to be stored at a length configured by the
528 # downstream project.
529 days-to-keep: "{build-days-to-keep}"
530 # Do not allow artifacts to be stored in Jenkins.
531 artifact-num-to-keep: 0
538 name: lf-jacoco-report
541 exec-pattern: "**/**.exec"
542 class-pattern: "**/classes"
543 source-pattern: "**/src/main/java"
544 # yamllint disable-line rule:line-length
545 exclusion-pattern: "**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**"
556 name: lf-infra-publish
557 # lf-infra macro to finish up a build.
559 # Handles the following:
560 # - Shipping logs to Nexus logs site repository
561 # - Cleanup workspace
574 - lf-infra-package-listing
576 mark-unstable-if-failed: true
579 # Do not clean up *.jenkins-trigger files for jobs that use a
580 # properties file as input for triggering another build.
581 - "**/*.jenkins-trigger"
585 name: lf-infra-publish-windows
586 # lf-infra macro to finish up a build.
588 # Handles the following:
589 # - Shipping logs to Nexus logs site repository
590 # - Cleanup workspace
592 # TODO: RELENG-1228 Develop log shipping script for Windows systems
603 # - lf-infra-ship-logs-windows
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"
617 name: lf-infra-gerrit-scm
620 credentials-id: "{jenkins-ssh-credential}"
624 - "refs/heads/{branch}"
628 disable: "{submodule-disable}"
629 recursive: "{submodule-recursive}"
630 timeout: "{submodule-timeout}"
631 choosing-strategy: "{choosing-strategy}"
634 name: lf-infra-github-scm
637 credentials-id: "{jenkins-ssh-credential}"
645 disable: "{submodule-disable}"
646 recursive: "{submodule-recursive}"
647 timeout: "{submodule-timeout}"
648 choosing-strategy: "{choosing-strategy}"
655 name: lf-infra-wrappers-common
660 timeout: "{build-timeout}"
661 timeout-var: "BUILD_TIMEOUT"
668 name: lf-infra-wrappers
670 - lf-infra-wrappers-common:
671 build-timeout: "{build-timeout}"
672 - config-file-provider:
675 target: "$HOME/.npmrc"
677 target: "$HOME/.config/pip/pip.conf"
678 - ssh-agent-credentials:
680 - "{jenkins-ssh-credential}"
683 name: lf-infra-wrappers-windows
685 - lf-infra-wrappers-common:
686 build-timeout: "{build-timeout}"