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 properties-content: |
282 DEFAULT_VERSION={default-version}
283 - shell: !include-raw: ../shell/rtdv3.sh
286 name: check-info-votes
289 properties-content: JENKINS_SSH_CREDENTIAL={jenkins-ssh-credential}
290 - shell: !include-raw-escape: ../shell/check-info-votes.sh
295 - config-file-provider:
297 - file-id: lftoolsini
298 target: "$HOME/.config/lftools/lftools.ini"
299 - shell: !include-raw: ../shell/release-job.sh
302 name: lf-sigul-sign-dir
303 # Requires that Jenkins be configured with SIGUL_BRIDGE_IP as a global
304 # Environment variable
307 condition-kind: boolean-expression
308 condition-expression: "{sign-artifacts}"
310 - config-file-provider:
312 - file-id: sigul-config
313 variable: SIGUL_CONFIG
314 - file-id: sigul-password
315 variable: SIGUL_PASSWORD
318 - shell: !include-raw-escape: ../shell/sigul-configuration.sh
319 - shell: !include-raw-escape: ../shell/sigul-install.sh
321 properties-content: |
323 SIGN_MODE={sign-mode}
324 - shell: !include-raw-escape:
325 - ../shell/sigul-sign-dir.sh
326 - shell: !include-raw-escape: ../shell/sigul-configuration-cleanup.sh
329 name: lf-infra-provide-docker-cleanup
333 set +e # DO NOT cause build failure if docker rmi fails
334 docker rmi -f $(docker images -a -q)
339 # Run a Sonar Jenkins Plugin
343 scanner-name: SonarQubeScanner
345 project: "{sonar-project-file}"
346 properties: "{sonar-properties}"
347 java-opts: "{sonar-java-opts}"
348 additional-arguments: "{sonar-additional-args}"
351 name: lf-infra-sonar-with-prescan
352 # Run a Sonar Jenkins Plugin
354 - lf-sonar-prescan # Must be defined by caller
357 scanner-name: SonarQubeScanner
359 project: "{sonar-project-file}"
360 properties: "{sonar-properties}"
361 java-opts: "{sonar-java-opts}"
362 additional-arguments: "{sonar-additional-args}"
369 name: lf-clm-parameters
373 default: "{nexus-iq-stage}"
375 Stage the policy evaluation will be run against on the Nexus IQ Server.
378 name: lf-cmake-parameters
379 # Parameters useful in CMake builds.
383 default: "{build-dir}"
384 description: "Directory to build the project in."
387 default: "{cmake-opts}"
389 Options to pass to CMAKE.
390 Example: -DCMAKE_INSTALL_PREFIX=$WORKSPACE/target/output
393 default: "{install-prefix}"
394 description: "Install prefix for C/C++ builds. Example: /usr/local"
397 default: "{make-opts}"
398 description: "Options to pass to make. Example: -j8"
401 name: lf-infra-maven-parameters
405 # Sets an env var for shell scripts to be able to call the dynamically
406 # installed maven without having to calculate the M2_HOME themselves.
407 default: "/w/tools/hudson.tasks.Maven_MavenInstallation/{mvn-version}"
408 description: "Maven selector to be used by shell scripts"
411 default: "{mvn-opts}"
413 Maven Java opts. Example: -Xmx1024m -XX:MaxPermSize=256m
416 default: "{mvn-params}"
418 Maven parameters to pass to the mvn command.
421 # Sets an env var for shell scripts to be able to call the dynamically
422 # installed maven without having to calculate the path themselves.
423 # yamllint disable-line rule:line-length
424 default: "/w/tools/hudson.tasks.Maven_MavenInstallation/{mvn-version}/bin/mvn"
425 description: "Maven selector to be used by shell scripts"
428 name: lf-infra-openstack-parameters
432 default: "{os-cloud}"
434 The name of a cloud configuration in clouds.yaml. OS_CLOUD is a
435 variable name that is significant to openstack client as a
436 environment variable. Please refer to the documentation for
438 https://docs.openstack.org/developer/python-openstackclient/
441 name: lf-infra-parameters
442 # Standard parameters used in the LF CI environments. Gerrit variables are
443 # not used by GitHub projects, but defining them isn't harmful.
449 Parameter to identify a SCM project to build. This is typically
450 the project repo path. For example: ofextensions/circuitsw
455 Stream is often set to the same name as 'branch' but can
456 sometimes be used as a name representing a project's release code
462 Gerrit Trigger provided parameter to identify Gerrit project that
463 triggered the build. This is typically the project repo path as
464 exists in Gerrit. For example: ofextensions/circuitsw
466 If using Gerrit, in a manual build this should match the PROJECT
472 Gerrit Trigger provided parameter to identify a Gerrit branch.
474 If using Gerrit, in a manual build override with the branch to
478 default: "refs/heads/{branch}"
480 Gerrit Trigger provided parameter to identify a refspec to fetch
483 If using Gerrit, in a manual build override with a refspec.
484 https://git-scm.com/book/en/v2/Git-Internals-The-Refspec
485 For example: 'refs/heads/master'
488 default: "origin/{branch}"
490 GitHub PR Trigger provided parameter for specifying the commit
493 If using GitHub, in a manual build override with a branch path or
494 sha1 hash to a specific commit. For example: 'origin/master'
497 name: lf-infra-node-parameters
501 default: "{node-dir}"
502 description: Path to a Node project directory.
505 default: "{node-version}"
506 description: Version of NodeJS to install.
509 name: lf-infra-tox-parameters
515 Path to directory containing tox.ini file.
518 default: "{tox-envs}"
520 Tox environments to run build against.
521 Example: docs,py2,py3
524 name: lf-build-with-parameters-maven-release
529 description: "Version to release, for example: 1.0.0"
533 description: "Tag to push to git repo; optional, defaults to VERSION"
537 description: "Log dir, for example: project-maven-stage-master/17/"
539 name: DISTRIBUTION_TYPE
544 description: "Set to maven for build with parameters"
546 name: USE_RELEASE_FILE
547 default: "{use-release-file}"
548 description: "Set to False for job built with parameters"
555 name: lf-infra-properties
558 # Allow build data to be stored at a length configured by the
559 # downstream project.
560 days-to-keep: "{build-days-to-keep}"
561 # Do not allow artifacts to be stored in Jenkins.
562 artifact-num-to-keep: 0
569 name: lf-jacoco-report
572 exec-pattern: "**/**.exec"
573 class-pattern: "**/classes"
574 source-pattern: "**/src/main/java"
575 # yamllint disable-line rule:line-length
576 exclusion-pattern: "**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**"
587 name: lf-infra-publish
588 # lf-infra macro to finish up a build.
590 # Handles the following:
591 # - Shipping logs to Nexus logs site repository
592 # - Cleanup workspace
605 - lf-infra-package-listing
607 mark-unstable-if-failed: true
610 # Do not clean up *.jenkins-trigger files for jobs that use a
611 # properties file as input for triggering another build.
612 - "**/*.jenkins-trigger"
616 name: lf-infra-publish-windows
617 # lf-infra macro to finish up a build.
619 # Handles the following:
620 # - Shipping logs to Nexus logs site repository
621 # - Cleanup workspace
623 # TODO: RELENG-1228 Develop log shipping script for Windows systems
634 # - lf-infra-ship-logs-windows
635 # mark-unstable-if-failed: true
638 # Do not clean up *.jenkins-trigger files for jobs that use a
639 # properties file as input for triggering another build.
640 - "**/*.jenkins-trigger"
648 name: lf-infra-gerrit-scm
651 credentials-id: "{jenkins-ssh-credential}"
655 - "refs/heads/{branch}"
659 disable: "{submodule-disable}"
660 recursive: "{submodule-recursive}"
661 timeout: "{submodule-timeout}"
662 choosing-strategy: "{choosing-strategy}"
665 name: lf-infra-github-scm
668 credentials-id: "{jenkins-ssh-credential}"
676 disable: "{submodule-disable}"
677 recursive: "{submodule-recursive}"
678 timeout: "{submodule-timeout}"
679 choosing-strategy: "{choosing-strategy}"
686 name: lf-infra-wrappers-common
691 timeout: "{build-timeout}"
692 timeout-var: "BUILD_TIMEOUT"
699 name: lf-infra-wrappers
701 - lf-infra-wrappers-common:
702 build-timeout: "{build-timeout}"
703 - config-file-provider:
706 target: "$HOME/.npmrc"
708 target: "$HOME/.config/pip/pip.conf"
709 - ssh-agent-credentials:
711 - "{jenkins-ssh-credential}"
714 name: lf-infra-wrappers-windows
716 - lf-infra-wrappers-common:
717 build-timeout: "{build-timeout}"