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"
74 condition-kind: regex-match
78 - config-file-provider:
80 - file-id: "jenkins-s3-log-ship"
81 target: $HOME/.aws/credentials
82 - lf-infra-create-netrc:
84 - shell: !include-raw:
85 # Ensure python-tools are installed in case job template does not
86 # call the lf-infra-pre-build macro.
87 - ../shell/python-tools-install.sh
88 - shell: !include-raw:
89 - ../shell/sudo-logs.sh
90 - shell: !include-raw:
91 - ../shell/job-cost.sh
92 - shell: !include-raw:
93 - ../shell/logs-deploy.sh
94 - shell: !include-raw:
95 - ../shell/logs-clear-credentials.sh
97 regexp: "^Build logs: .*"
100 name: lf-infra-package-listing
102 - shell: !include-raw:
103 - ../shell/package-listing.sh
106 name: lf-infra-packer-build
109 condition-kind: boolean-expression
110 condition-expression: "{openstack}"
112 - config-file-provider:
114 - file-id: clouds-yaml
115 target: "$HOME/.config/openstack/clouds.yaml"
117 properties-content: OS_CLOUD={openstack-cloud}
118 - config-file-provider:
120 - file-id: "{packer-cloud-settings}"
123 properties-content: |
124 PACKER_PLATFORM={platform}
125 PACKER_TEMPLATE={template}
126 PACKER_VERSION={packer-version}
127 UPDATE_CLOUD_IMAGE={update-cloud-image}
128 - shell: !include-raw-escape:
129 - ../shell/packer-install.sh
130 - ../shell/packer-build.sh
131 - shell: !include-raw:
132 - ../shell/packer-clear-credentials.sh
135 name: lf-infra-packer-validate
138 condition-kind: boolean-expression
139 condition-expression: "{openstack}"
141 - config-file-provider:
143 - file-id: clouds-yaml
144 target: "$HOME/.config/openstack/clouds.yaml"
146 properties-content: OS_CLOUD={openstack-cloud}
147 - config-file-provider:
149 - file-id: "{packer-cloud-settings}"
152 properties-content: |
153 PACKER_VERSION={packer-version}
154 - shell: !include-raw-escape:
155 - ../shell/packer-install.sh
156 - ../shell/packer-validate.sh
157 - shell: !include-raw:
158 - ../shell/packer-clear-credentials.sh
161 name: lf-infra-update-packer-images
163 - shell: !include-raw: ../shell/update-cloud-images.sh
166 name: lf-infra-push-gerrit-patch
169 properties-content: |
171 GERRIT_COMMIT_MESSAGE={gerrit-commit-message}
172 GERRIT_HOST={gerrit-host}
173 GERRIT_TOPIC={gerrit-topic}
174 GERRIT_USER={gerrit-user}
175 REVIEWERS_EMAIL={reviewers-email}
176 - shell: !include-raw-escape: ../shell/gerrit-push-patch.sh
179 name: lf-infra-sysstat
181 - shell: !include-raw:
182 - ../shell/sysstat.sh
185 name: lf-jacoco-nojava-workaround
187 - shell: "mkdir -p $WORKSPACE/target/classes $WORKSPACE/jacoco/classes"
190 name: lf-infra-deploy-maven-file
193 mvn-version: "{mvn-version}"
194 - lf-provide-maven-settings:
195 global-settings-file: "{global-settings-file}"
196 settings-file: "{settings-file}"
198 properties-content: |
199 MAVEN_REPO_URL={maven-repo-url}
202 UPLOAD_FILES_PATH={upload-files-dir}
203 - shell: !include-raw-escape:
204 - ../shell/common-variables.sh
205 - ../shell/deploy-maven-file.sh
206 - lf-provide-maven-settings-cleanup
209 name: lf-maven-central
212 condition-kind: boolean-expression
213 condition-expression: "{mvn-central}"
215 - lf-provide-maven-settings:
216 global-settings-file: "{mvn-global-settings}"
217 settings-file: "{mvn-settings}"
218 - lf-infra-create-netrc:
221 properties-content: "OSSRH_PROFILE_ID={ossrh-profile-id}"
222 - shell: !include-raw-escape: ../shell/maven-central.sh
223 - lf-provide-maven-settings-cleanup
226 name: lf-maven-install
228 # Create a $HOME/.wgetrc to make the Maven download quiet.
229 - shell: 'echo "quiet=on" > "$HOME/.wgetrc"'
231 maven-version: "{mvn-version}"
233 - shell: 'rm "$HOME/.wgetrc"'
236 name: lf-provide-maven-settings
238 - config-file-provider:
240 - file-id: "{global-settings-file}"
241 variable: "GLOBAL_SETTINGS_FILE"
242 - file-id: "{settings-file}"
243 variable: "SETTINGS_FILE"
246 name: lf-provide-maven-settings-cleanup
250 set +e # DO NOT cause build failure if any of the rm calls fail.
252 rm -f "$GLOBAL_SETTINGS_FILE" "$SETTINGS_FILE"
254 # In some cases we use the lf-provide-maven-settings macro to produce
255 # a "$HOME/.netrc" file containing credentials. Remove that file here
259 # DO NOT fail build if any of the above lines fail.
263 name: lf-rtd-trigger-build
266 properties-content: |
267 RTD_BUILD_URL={rtd-build-url}
268 RTD_TOKEN={rtd-token}
269 - shell: !include-raw-escape: ../shell/rtd-trigger-build.sh
275 properties-content: |
277 PYTHON={python-version}
278 - shell: !include-raw-escape: ../shell/tox-install.sh
279 - shell: !include-raw-escape: ../shell/rtd-verify.sh
285 properties-content: |
286 DEFAULT_VERSION={default-version}
287 - shell: !include-raw-escape: ../shell/rtdv3.sh
290 name: check-info-votes
293 properties-content: JENKINS_SSH_CREDENTIAL={jenkins-ssh-credential}
294 - shell: !include-raw-escape: ../shell/check-info-votes.sh
299 - config-file-provider:
301 - file-id: lftoolsini
302 target: "$HOME/.config/lftools/lftools.ini"
303 - shell: !include-raw: ../shell/release-job.sh
306 name: lf-sigul-sign-dir
307 # Requires that Jenkins be configured with SIGUL_BRIDGE_IP as a global
308 # Environment variable
311 condition-kind: boolean-expression
312 condition-expression: "{sign-artifacts}"
314 - config-file-provider:
316 - file-id: sigul-config
317 variable: SIGUL_CONFIG
318 - file-id: sigul-password
319 variable: SIGUL_PASSWORD
322 - shell: !include-raw-escape: ../shell/sigul-configuration.sh
323 - shell: !include-raw-escape: ../shell/sigul-install.sh
325 properties-content: |
327 SIGN_MODE={sign-mode}
328 - shell: !include-raw-escape:
329 - ../shell/sigul-sign-dir.sh
330 - shell: !include-raw-escape: ../shell/sigul-configuration-cleanup.sh
333 name: lf-infra-provide-docker-cleanup
337 set +e # DO NOT cause build failure if docker rmi fails
338 docker rmi -f $(docker images -a -q)
343 # Run a Sonar Jenkins Plugin
347 scanner-name: SonarQubeScanner
349 project: "{sonar-project-file}"
350 properties: "{sonar-properties}"
351 java-opts: "{sonar-java-opts}"
352 additional-arguments: "{sonar-additional-args}"
355 name: lf-infra-sonar-with-prescan
356 # Run a Sonar Jenkins Plugin
358 - lf-sonar-prescan # Must be defined by caller
361 scanner-name: SonarQubeScanner
363 project: "{sonar-project-file}"
364 properties: "{sonar-properties}"
365 java-opts: "{sonar-java-opts}"
366 additional-arguments: "{sonar-additional-args}"
373 name: lf-clm-parameters
377 default: "{nexus-iq-stage}"
379 Stage the policy evaluation will be run against on the Nexus IQ Server.
382 name: lf-cmake-parameters
383 # Parameters useful in CMake builds.
387 default: "{build-dir}"
388 description: "Directory to build the project in."
391 default: "{cmake-opts}"
393 Options to pass to CMAKE.
394 Example: -DCMAKE_INSTALL_PREFIX=$WORKSPACE/target/output
397 default: "{install-prefix}"
398 description: "Install prefix for C/C++ builds. Example: /usr/local"
401 default: "{make-opts}"
402 description: "Options to pass to make. Example: -j8"
405 name: lf-infra-maven-parameters
409 # Sets an env var for shell scripts to be able to call the dynamically
410 # installed maven without having to calculate the M2_HOME themselves.
411 default: "/w/tools/hudson.tasks.Maven_MavenInstallation/{mvn-version}"
412 description: "Maven selector to be used by shell scripts"
415 default: "{mvn-opts}"
417 Maven Java opts. Example: -Xmx1024m -XX:MaxPermSize=256m
420 default: "{mvn-params}"
422 Maven parameters to pass to the mvn command.
425 # Sets an env var for shell scripts to be able to call the dynamically
426 # installed maven without having to calculate the path themselves.
427 # yamllint disable-line rule:line-length
428 default: "/w/tools/hudson.tasks.Maven_MavenInstallation/{mvn-version}/bin/mvn"
429 description: "Maven selector to be used by shell scripts"
432 name: lf-infra-openstack-parameters
436 default: "{os-cloud}"
438 The name of a cloud configuration in clouds.yaml. OS_CLOUD is a
439 variable name that is significant to openstack client as a
440 environment variable. Please refer to the documentation for
442 https://docs.openstack.org/developer/python-openstackclient/
445 name: lf-infra-parameters
446 # Standard parameters used in the LF CI environments. Gerrit variables are
447 # not used by GitHub projects, but defining them isn't harmful.
453 Parameter to identify a SCM project to build. This is typically
454 the project repo path. For example: ofextensions/circuitsw
459 Stream is often set to the same name as 'branch' but can
460 sometimes be used as a name representing a project's release code
466 Gerrit Trigger provided parameter to identify Gerrit project that
467 triggered the build. This is typically the project repo path as
468 exists in Gerrit. For example: ofextensions/circuitsw
470 If using Gerrit, in a manual build this should match the PROJECT
476 Gerrit Trigger provided parameter to identify a Gerrit branch.
478 If using Gerrit, in a manual build override with the branch to
482 default: "refs/heads/{branch}"
484 Gerrit Trigger provided parameter to identify a refspec to fetch
487 If using Gerrit, in a manual build override with a refspec.
488 https://git-scm.com/book/en/v2/Git-Internals-The-Refspec
489 For example: 'refs/heads/master'
492 default: "origin/{branch}"
494 GitHub PR Trigger provided parameter for specifying the commit
497 If using GitHub, in a manual build override with a branch path or
498 sha1 hash to a specific commit. For example: 'origin/master'
501 name: lf-infra-node-parameters
505 default: "{node-dir}"
506 description: Path to a Node project directory.
509 default: "{node-version}"
510 description: Version of NodeJS to install.
513 name: lf-infra-tox-parameters
519 Path to directory containing tox.ini file.
522 default: "{tox-envs}"
524 Tox environments to run build against.
525 Example: docs,py2,py3
528 name: lf-build-with-parameters-maven-release
533 description: "Version to release, for example: 1.0.0"
537 description: "Tag to push to git repo; optional, defaults to VERSION"
541 description: "Log dir, for example: project-maven-stage-master/17/"
543 name: DISTRIBUTION_TYPE
548 description: "Set to maven for build with parameters"
550 name: USE_RELEASE_FILE
551 default: "{use-release-file}"
552 description: "Set to False for job built with parameters"
559 name: lf-infra-properties
562 # Allow build data to be stored at a length configured by the
563 # downstream project.
564 days-to-keep: "{build-days-to-keep}"
565 # Do not allow artifacts to be stored in Jenkins.
566 artifact-num-to-keep: 0
573 name: lf-jacoco-report
576 exec-pattern: "**/**.exec"
577 class-pattern: "**/classes"
578 source-pattern: "**/src/main/java"
579 # yamllint disable-line rule:line-length
580 exclusion-pattern: "**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**"
591 name: lf-infra-publish
592 # lf-infra macro to finish up a build.
594 # Handles the following:
595 # - Shipping logs to Nexus logs site repository
596 # - Cleanup workspace
609 - lf-infra-package-listing
611 mark-unstable-if-failed: true
614 # Do not clean up *.jenkins-trigger files for jobs that use a
615 # properties file as input for triggering another build.
616 - "**/*.jenkins-trigger"
620 name: lf-infra-publish-windows
621 # lf-infra macro to finish up a build.
623 # Handles the following:
624 # - Shipping logs to Nexus logs site repository
625 # - Cleanup workspace
627 # TODO: RELENG-1228 Develop log shipping script for Windows systems
638 # - lf-infra-ship-logs-windows
639 # mark-unstable-if-failed: true
642 # Do not clean up *.jenkins-trigger files for jobs that use a
643 # properties file as input for triggering another build.
644 - "**/*.jenkins-trigger"
652 name: lf-infra-gerrit-scm
655 credentials-id: "{jenkins-ssh-credential}"
659 - "refs/heads/{branch}"
663 disable: "{submodule-disable}"
664 recursive: "{submodule-recursive}"
665 timeout: "{submodule-timeout}"
666 choosing-strategy: "{choosing-strategy}"
669 name: lf-infra-github-scm
672 credentials-id: "{jenkins-ssh-credential}"
680 disable: "{submodule-disable}"
681 recursive: "{submodule-recursive}"
682 timeout: "{submodule-timeout}"
683 choosing-strategy: "{choosing-strategy}"
690 name: lf-infra-wrappers-common
695 timeout: "{build-timeout}"
696 timeout-var: "BUILD_TIMEOUT"
703 name: lf-infra-wrappers
705 - lf-infra-wrappers-common:
706 build-timeout: "{build-timeout}"
707 - config-file-provider:
710 target: "$HOME/.npmrc"
712 target: "$HOME/.config/pip/pip.conf"
713 - ssh-agent-credentials:
715 - "{jenkins-ssh-credential}"
718 name: lf-infra-wrappers-windows
720 - lf-infra-wrappers-common:
721 build-timeout: "{build-timeout}"