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
282 condition-kind: file-exists
283 condition-filename: .readthedocs.yaml
284 on-evaluation-failure: dont-run
287 properties-content: |
288 TOX_ENVS=docs,docs-linkcheck
290 - lf-infra-tox-install:
291 python-version: "python3"
292 - shell: !include-raw: ../shell/tox-run.sh
293 - shell: !include-raw: ../shell/rtdv3.sh
296 name: check-info-votes
299 properties-content: JENKINS_SSH_CREDENTIAL={jenkins-ssh-credential}
300 - shell: !include-raw-escape: ../shell/check-info-votes.sh
305 - config-file-provider:
307 - file-id: lftoolsini
308 target: "$HOME/.config/lftools/lftools.ini"
309 - shell: !include-raw: ../shell/release-job.sh
312 name: lf-sigul-sign-dir
313 # Requires that Jenkins be configured with SIGUL_BRIDGE_IP as a global
314 # Environment variable
317 condition-kind: boolean-expression
318 condition-expression: "{sign-artifacts}"
320 - config-file-provider:
322 - file-id: sigul-config
323 variable: SIGUL_CONFIG
324 - file-id: sigul-password
325 variable: SIGUL_PASSWORD
328 - shell: !include-raw-escape: ../shell/sigul-configuration.sh
329 - shell: !include-raw-escape: ../shell/sigul-install.sh
331 properties-content: |
333 SIGN_MODE={sign-mode}
334 - shell: !include-raw-escape:
335 - ../shell/sigul-sign-dir.sh
336 - shell: !include-raw-escape: ../shell/sigul-configuration-cleanup.sh
339 name: lf-infra-provide-docker-cleanup
343 set +e # DO NOT cause build failure if docker rmi fails
344 docker rmi -f $(docker images -a -q)
349 # Run a Sonar Jenkins Plugin
353 scanner-name: SonarQubeScanner
355 project: "{sonar-project-file}"
356 properties: "{sonar-properties}"
357 java-opts: "{sonar-java-opts}"
358 additional-arguments: "{sonar-additional-args}"
361 name: lf-infra-sonar-with-prescan
362 # Run a Sonar Jenkins Plugin
364 - lf-sonar-prescan # Must be defined by caller
367 scanner-name: SonarQubeScanner
369 project: "{sonar-project-file}"
370 properties: "{sonar-properties}"
371 java-opts: "{sonar-java-opts}"
372 additional-arguments: "{sonar-additional-args}"
379 name: lf-clm-parameters
383 default: "{nexus-iq-stage}"
385 Stage the policy evaluation will be run against on the Nexus IQ Server.
388 name: lf-cmake-parameters
389 # Parameters useful in CMake builds.
393 default: "{build-dir}"
394 description: "Directory to build the project in."
397 default: "{cmake-opts}"
399 Options to pass to CMAKE.
400 Example: -DCMAKE_INSTALL_PREFIX=$WORKSPACE/target/output
403 default: "{install-prefix}"
404 description: "Install prefix for C/C++ builds. Example: /usr/local"
407 default: "{make-opts}"
408 description: "Options to pass to make. Example: -j8"
411 name: lf-infra-maven-parameters
415 # Sets an env var for shell scripts to be able to call the dynamically
416 # installed maven without having to calculate the M2_HOME themselves.
417 default: "/w/tools/hudson.tasks.Maven_MavenInstallation/{mvn-version}"
418 description: "Maven selector to be used by shell scripts"
421 default: "{mvn-opts}"
423 Maven Java opts. Example: -Xmx1024m -XX:MaxPermSize=256m
426 default: "{mvn-params}"
428 Maven parameters to pass to the mvn command.
431 # Sets an env var for shell scripts to be able to call the dynamically
432 # installed maven without having to calculate the path themselves.
433 # yamllint disable-line rule:line-length
434 default: "/w/tools/hudson.tasks.Maven_MavenInstallation/{mvn-version}/bin/mvn"
435 description: "Maven selector to be used by shell scripts"
438 name: lf-infra-openstack-parameters
442 default: "{os-cloud}"
444 The name of a cloud configuration in clouds.yaml. OS_CLOUD is a
445 variable name that is significant to openstack client as a
446 environment variable. Please refer to the documentation for
448 https://docs.openstack.org/developer/python-openstackclient/
451 name: lf-infra-parameters
452 # Standard parameters used in the LF CI environments. Gerrit variables are
453 # not used by GitHub projects, but defining them isn't harmful.
459 Parameter to identify a SCM project to build. This is typically
460 the project repo path. For example: ofextensions/circuitsw
465 Stream is often set to the same name as 'branch' but can
466 sometimes be used as a name representing a project's release code
472 Gerrit Trigger provided parameter to identify Gerrit project that
473 triggered the build. This is typically the project repo path as
474 exists in Gerrit. For example: ofextensions/circuitsw
476 If using Gerrit, in a manual build this should match the PROJECT
482 Gerrit Trigger provided parameter to identify a Gerrit branch.
484 If using Gerrit, in a manual build override with the branch to
488 default: "refs/heads/{branch}"
490 Gerrit Trigger provided parameter to identify a refspec to fetch
493 If using Gerrit, in a manual build override with a refspec.
494 https://git-scm.com/book/en/v2/Git-Internals-The-Refspec
495 For example: 'refs/heads/master'
498 default: "origin/{branch}"
500 GitHub PR Trigger provided parameter for specifying the commit
503 If using GitHub, in a manual build override with a branch path or
504 sha1 hash to a specific commit. For example: 'origin/master'
507 name: lf-infra-node-parameters
511 default: "{node-dir}"
512 description: Path to a Node project directory.
515 default: "{node-version}"
516 description: Version of NodeJS to install.
519 name: lf-infra-tox-parameters
525 Path to directory containing tox.ini file.
528 default: "{tox-envs}"
530 Tox environments to run build against.
531 Example: docs,py2,py3
534 name: lf-build-with-parameters-maven-release
539 description: "Version to release, for example: 1.0.0"
543 description: "Tag to push to git repo; optional, defaults to VERSION"
547 description: "Log dir, for example: project-maven-stage-master/17/"
549 name: DISTRIBUTION_TYPE
554 description: "Set to maven for build with parameters"
556 name: USE_RELEASE_FILE
557 default: "{use-release-file}"
558 description: "Set to False for job built with parameters"
565 name: lf-infra-properties
568 # Allow build data to be stored at a length configured by the
569 # downstream project.
570 days-to-keep: "{build-days-to-keep}"
571 # Do not allow artifacts to be stored in Jenkins.
572 artifact-num-to-keep: 0
579 name: lf-jacoco-report
582 exec-pattern: "**/**.exec"
583 class-pattern: "**/classes"
584 source-pattern: "**/src/main/java"
585 # yamllint disable-line rule:line-length
586 exclusion-pattern: "**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**"
597 name: lf-infra-publish
598 # lf-infra macro to finish up a build.
600 # Handles the following:
601 # - Shipping logs to Nexus logs site repository
602 # - Cleanup workspace
615 - lf-infra-package-listing
617 mark-unstable-if-failed: true
620 # Do not clean up *.jenkins-trigger files for jobs that use a
621 # properties file as input for triggering another build.
622 - "**/*.jenkins-trigger"
626 name: lf-infra-publish-windows
627 # lf-infra macro to finish up a build.
629 # Handles the following:
630 # - Shipping logs to Nexus logs site repository
631 # - Cleanup workspace
633 # TODO: RELENG-1228 Develop log shipping script for Windows systems
644 # - lf-infra-ship-logs-windows
645 # mark-unstable-if-failed: true
648 # Do not clean up *.jenkins-trigger files for jobs that use a
649 # properties file as input for triggering another build.
650 - "**/*.jenkins-trigger"
658 name: lf-infra-gerrit-scm
661 credentials-id: "{jenkins-ssh-credential}"
665 - "refs/heads/{branch}"
669 disable: "{submodule-disable}"
670 recursive: "{submodule-recursive}"
671 timeout: "{submodule-timeout}"
672 choosing-strategy: "{choosing-strategy}"
675 name: lf-infra-github-scm
678 credentials-id: "{jenkins-ssh-credential}"
686 disable: "{submodule-disable}"
687 recursive: "{submodule-recursive}"
688 timeout: "{submodule-timeout}"
689 choosing-strategy: "{choosing-strategy}"
696 name: lf-infra-wrappers-common
701 timeout: "{build-timeout}"
702 timeout-var: "BUILD_TIMEOUT"
709 name: lf-infra-wrappers
711 - lf-infra-wrappers-common:
712 build-timeout: "{build-timeout}"
713 - config-file-provider:
716 target: "$HOME/.npmrc"
718 target: "$HOME/.config/pip/pip.conf"
719 - ssh-agent-credentials:
721 - "{jenkins-ssh-credential}"
724 name: lf-infra-wrappers-windows
726 - lf-infra-wrappers-common:
727 build-timeout: "{build-timeout}"