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}"
341 name: lf-infra-sonar-with-prescan
342 # Run a Sonar Jenkins Plugin
344 - lf-sonar-prescan # Must be defined by caller
347 scanner-name: SonarQubeScanner
349 project: "sonar-project.properties"
350 properties: "{sonar-properties}"
351 java-opts: "{sonar-java-opts}"
352 additional-arguments: "{sonar-additional-args}"
359 name: lf-clm-parameters
363 default: "{nexus-iq-stage}"
365 Stage the policy evaluation will be run against on the Nexus IQ Server.
368 name: lf-cmake-parameters
369 # Parameters useful in CMake builds.
373 default: "{build-dir}"
374 description: "Directory to build the project in."
377 default: "{cmake-opts}"
379 Options to pass to CMAKE.
380 Example: -DCMAKE_INSTALL_PREFIX=$WORKSPACE/target/output
383 default: "{install-prefix}"
384 description: "Install prefix for C/C++ builds. Example: /usr/local"
387 default: "{make-opts}"
388 description: "Options to pass to make. Example: -j8"
391 name: lf-infra-maven-parameters
395 # Sets an env var for shell scripts to be able to call the dynamically
396 # installed maven without having to calculate the M2_HOME themselves.
397 default: "/w/tools/hudson.tasks.Maven_MavenInstallation/{mvn-version}"
398 description: "Maven selector to be used by shell scripts"
401 default: "{mvn-opts}"
403 Maven Java opts. Example: -Xmx1024m -XX:MaxPermSize=256m
406 default: "{mvn-params}"
408 Maven parameters to pass to the mvn command.
411 # Sets an env var for shell scripts to be able to call the dynamically
412 # installed maven without having to calculate the path themselves.
413 # yamllint disable-line rule:line-length
414 default: "/w/tools/hudson.tasks.Maven_MavenInstallation/{mvn-version}/bin/mvn"
415 description: "Maven selector to be used by shell scripts"
418 name: lf-infra-openstack-parameters
422 default: "{os-cloud}"
424 The name of a cloud configuration in clouds.yaml. OS_CLOUD is a
425 variable name that is significant to openstack client as a
426 environment variable. Please refer to the documentation for
428 https://docs.openstack.org/developer/python-openstackclient/
431 name: lf-infra-parameters
432 # Standard parameters used in the LF CI environments. Gerrit variables are
433 # not used by GitHub projects, but defining them isn't harmful.
439 Parameter to identify a SCM project to build. This is typically
440 the project repo path. For example: ofextensions/circuitsw
445 Stream is often set to the same name as 'branch' but can
446 sometimes be used as a name representing a project's release code
452 Gerrit Trigger provided parameter to identify Gerrit project that
453 triggered the build. This is typically the project repo path as
454 exists in Gerrit. For example: ofextensions/circuitsw
456 If using Gerrit, in a manual build this should match the PROJECT
462 Gerrit Trigger provided parameter to identify a Gerrit branch.
464 If using Gerrit, in a manual build override with the branch to
468 default: "refs/heads/{branch}"
470 Gerrit Trigger provided parameter to identify a refspec to fetch
473 If using Gerrit, in a manual build override with a refspec.
474 https://git-scm.com/book/en/v2/Git-Internals-The-Refspec
475 For example: 'refs/heads/master'
478 default: "origin/{branch}"
480 GitHub PR Trigger provided parameter for specifying the commit
483 If using GitHub, in a manual build override with a branch path or
484 sha1 hash to a specific commit. For example: 'origin/master'
487 name: lf-infra-node-parameters
491 default: "{node-dir}"
492 description: Path to a Node project directory.
495 default: "{node-version}"
496 description: Version of NodeJS to install.
499 name: lf-infra-tox-parameters
505 Path to directory containing tox.ini file.
508 default: "{tox-envs}"
510 Tox environments to run build against.
511 Example: docs,py2,py3
514 name: lf-build-with-parameters-maven-release
519 description: "This is the tag, Example: 1.0.0"
523 description: "Log dir, example: project-maven-stage-master/17/"
525 name: DISTRIBUTION_TYPE
530 description: "Set to maven for build with parameters"
532 name: USE_RELEASE_FILE
533 default: "{use-release-file}"
534 description: "Set to False for job built with parameters"
541 name: lf-infra-properties
544 # Allow build data to be stored at a length configured by the
545 # downstream project.
546 days-to-keep: "{build-days-to-keep}"
547 # Do not allow artifacts to be stored in Jenkins.
548 artifact-num-to-keep: 0
555 name: lf-jacoco-report
558 exec-pattern: "**/**.exec"
559 class-pattern: "**/classes"
560 source-pattern: "**/src/main/java"
561 # yamllint disable-line rule:line-length
562 exclusion-pattern: "**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**"
573 name: lf-infra-publish
574 # lf-infra macro to finish up a build.
576 # Handles the following:
577 # - Shipping logs to Nexus logs site repository
578 # - Cleanup workspace
591 - lf-infra-package-listing
593 mark-unstable-if-failed: true
596 # Do not clean up *.jenkins-trigger files for jobs that use a
597 # properties file as input for triggering another build.
598 - "**/*.jenkins-trigger"
602 name: lf-infra-publish-windows
603 # lf-infra macro to finish up a build.
605 # Handles the following:
606 # - Shipping logs to Nexus logs site repository
607 # - Cleanup workspace
609 # TODO: RELENG-1228 Develop log shipping script for Windows systems
620 # - lf-infra-ship-logs-windows
621 # mark-unstable-if-failed: true
624 # Do not clean up *.jenkins-trigger files for jobs that use a
625 # properties file as input for triggering another build.
626 - "**/*.jenkins-trigger"
634 name: lf-infra-gerrit-scm
637 credentials-id: "{jenkins-ssh-credential}"
641 - "refs/heads/{branch}"
645 disable: "{submodule-disable}"
646 recursive: "{submodule-recursive}"
647 timeout: "{submodule-timeout}"
648 choosing-strategy: "{choosing-strategy}"
651 name: lf-infra-github-scm
654 credentials-id: "{jenkins-ssh-credential}"
662 disable: "{submodule-disable}"
663 recursive: "{submodule-recursive}"
664 timeout: "{submodule-timeout}"
665 choosing-strategy: "{choosing-strategy}"
672 name: lf-infra-wrappers-common
677 timeout: "{build-timeout}"
678 timeout-var: "BUILD_TIMEOUT"
685 name: lf-infra-wrappers
687 - lf-infra-wrappers-common:
688 build-timeout: "{build-timeout}"
689 - config-file-provider:
692 target: "$HOME/.npmrc"
694 target: "$HOME/.config/pip/pip.conf"
695 - ssh-agent-credentials:
697 - "{jenkins-ssh-credential}"
700 name: lf-infra-wrappers-windows
702 - lf-infra-wrappers-common:
703 build-timeout: "{build-timeout}"