Chore: Upgrade Jenkins-job-builder to 6.3.0
[releng/global-jjb.git] / jjb / lf-macros.yaml
1 ---
2 ############
3 # BUILDERS #
4 ############
5
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.
9 - builder:
10     name: comment-to-gerrit
11     builders:
12       - shell: !include-raw: ../shell/comment-to-gerrit.sh
13
14 - builder:
15     name: lf-ansible-config-file-provider
16     builders:
17       - config-file-provider:
18           files:
19             - file-id: "ansible-cfg"
20               target: "$HOME/.ansible/ansible.cfg"
21
22 - builder:
23     name: lf-fetch-dependent-patches
24     builders:
25       - shell: !include-raw-escape: ../shell/gerrit-fetch-dependencies.sh
26       - inject:
27           properties-file: $WORKSPACE/.dependency.properties
28
29 - builder:
30     name: lf-license-check
31     builders:
32       - inject:
33           properties-content: |
34             FILE_PATTERNS={file-patterns}
35             SPDX_DISABLE={spdx-disable}
36             LHC_VERSION={lhc-version}
37             LICENSE_EXCLUDE_PATHS={license-exclude-paths}
38             LICENSES_ALLOWED={licenses-allowed}
39       - shell: !include-raw-escape:
40           - ../shell/license-check.sh
41
42 - builder:
43     name: lf-infra-capture-instance-metadata
44     builders:
45       - shell: !include-raw-escape:
46           - ../shell/capture-instance-metadata.sh
47
48 - builder:
49     name: lf-infra-create-netrc
50     builders:
51       - inject:
52           properties-content: "SERVER_ID={server-id}"
53       - shell: !include-raw-escape: ../shell/create-netrc.sh
54
55 - builder:
56     name: lf-infra-docker-login
57     builders:
58       - lf-provide-maven-settings:
59           global-settings-file: "{global-settings-file}"
60           settings-file: "{settings-file}"
61       - shell: !include-raw-escape: ../shell/docker-login.sh
62       - lf-provide-maven-settings-cleanup
63
64 - builder:
65     name: lf-infra-gpg-verify-git-signature
66     # TODO: Verify signature after downloading users public key from a locally
67     # created repository instead of the public keymesh. This requires a process
68     # in place to get ODL developers public keys into a local repository without
69     # increasing the job thoughput.
70     builders:
71       - shell: !include-raw: ../shell/gpg-verify-git-signature.sh
72
73 - builder:
74     name: lf-infra-pre-build
75     builders:
76       - shell: !include-raw-escape: ../shell/python-tools-install.sh
77
78 - builder:
79     name: lf-infra-ship-logs
80     builders:
81       # Ensure no pre-existing .netrc files are overriding logs config
82       - lf-provide-maven-settings-cleanup
83       - config-file-provider:
84           files:
85             - file-id: "jenkins-log-archives-settings"
86               variable: "SETTINGS_FILE"
87       - conditional-step:
88           condition-kind: regex-match
89           regex: "^.*logs-s3.*"
90           label: $S3_BUCKET
91           on-evaluation-failure: dont-run
92           steps:
93             - config-file-provider:
94                 files:
95                   - file-id: "jenkins-s3-log-ship"
96                     target: $HOME/.aws/credentials
97       - lf-infra-create-netrc:
98           server-id: logs
99       - shell: !include-raw:
100           # Ensure python-tools are installed in case job template does not
101           # call the lf-infra-pre-build macro.
102           - ../shell/python-tools-install.sh
103       - shell: !include-raw-escape:
104           - ../shell/sudo-logs.sh
105       - shell: !include-raw-escape:
106           - ../shell/job-cost.sh
107       - shell: !include-raw-escape:
108           - ../shell/logs-deploy.sh
109       - shell: !include-raw:
110           - ../shell/logs-clear-credentials.sh
111       - description-setter:
112           regexp: "(^(Nexus|S3) build logs: .*)"
113
114 - builder:
115     name: lf-infra-package-listing
116     builders:
117       - shell: !include-raw-escape:
118           - ../shell/package-listing.sh
119
120 - builder:
121     name: lf-infra-packer-build
122     builders:
123       - lf-ansible-config-file-provider
124       - conditional-step:
125           condition-kind: boolean-expression
126           condition-expression: "{openstack}"
127           steps:
128             - config-file-provider:
129                 files:
130                   - file-id: clouds-yaml
131                     target: "$HOME/.config/openstack/clouds.yaml"
132             - inject:
133                 properties-content: OS_CLOUD={openstack-cloud}
134       - config-file-provider:
135           files:
136             - file-id: "{packer-cloud-settings}"
137               target: "$HOME/.config/jenkins_jobs/cloud-env.pkrvars.hcl"
138               variable: CLOUDENV
139       - inject:
140           properties-content: |
141             PACKER_BUILDER={packer-builder}
142             PACKER_PLATFORM={platform}
143             PACKER_TEMPLATE={template}
144             PACKER_VERSION={packer-version}
145             UPDATE_CLOUD_IMAGE={update-cloud-image}
146       - shell: !include-raw-escape:
147           - ../shell/packer-install.sh
148           - ../shell/packer-build.sh
149       - shell: !include-raw:
150           - ../shell/packer-clear-credentials.sh
151
152 - builder:
153     name: lf-infra-packer-validate
154     builders:
155       - conditional-step:
156           condition-kind: boolean-expression
157           condition-expression: "{openstack}"
158           steps:
159             - config-file-provider:
160                 files:
161                   - file-id: clouds-yaml
162                     target: "$HOME/.config/openstack/clouds.yaml"
163             - inject:
164                 properties-content: OS_CLOUD={openstack-cloud}
165       - config-file-provider:
166           files:
167             - file-id: "{packer-cloud-settings}"
168               target: "$HOME/.config/jenkins_jobs/cloud-env.pkrvars.hcl"
169               variable: CLOUDENV
170       - inject:
171           properties-content: |
172             PACKER_VERSION={packer-version}
173       - shell: !include-raw-escape:
174           - ../shell/packer-install.sh
175           - ../shell/packer-validate.sh
176       - shell: !include-raw:
177           - ../shell/packer-clear-credentials.sh
178
179 - builder:
180     name: lf-infra-update-packer-images
181     builders:
182       - shell: !include-raw-escape: ../shell/update-cloud-images.sh
183
184 - builder:
185     name: lf-infra-push-gerrit-patch
186     builders:
187       - inject:
188           properties-content: |
189             PROJECT={project}
190             GERRIT_COMMIT_MESSAGE={gerrit-commit-message}
191             GERRIT_HOST={gerrit-host}
192             GERRIT_TOPIC={gerrit-topic}
193             GERRIT_USER={gerrit-user}
194             REVIEWERS_EMAIL={reviewers-email}
195       - shell: !include-raw-escape: ../shell/gerrit-push-patch.sh
196
197 - builder:
198     name: lf-infra-sysstat
199     builders:
200       - shell: !include-raw-escape:
201           - ../shell/sysstat.sh
202
203 - builder:
204     name: lf-jacoco-nojava-workaround
205     builders:
206       - shell: "mkdir -p $WORKSPACE/target/classes $WORKSPACE/jacoco/classes"
207
208 - builder:
209     name: lf-infra-deploy-maven-file
210     builders:
211       - lf-maven-install:
212           mvn-version: "{mvn-version}"
213       - lf-provide-maven-settings:
214           global-settings-file: "{global-settings-file}"
215           settings-file: "{settings-file}"
216       - inject:
217           properties-content: |
218             MAVEN_REPO_URL={maven-repo-url}
219             REPO_ID={repo-id}
220             GROUP_ID={group-id}
221             UPLOAD_FILES_PATH={upload-files-dir}
222       - shell: !include-raw-escape:
223           - ../shell/common-variables.sh
224           - ../shell/deploy-maven-file.sh
225       - lf-provide-maven-settings-cleanup
226
227 - builder:
228     name: lf-maven-central
229     builders:
230       - conditional-step:
231           condition-kind: boolean-expression
232           condition-expression: "{mvn-central}"
233           steps:
234             - lf-provide-maven-settings:
235                 global-settings-file: "{mvn-global-settings}"
236                 settings-file: "{mvn-settings}"
237             - lf-infra-create-netrc:
238                 server-id: "ossrh"
239             - inject:
240                 properties-content: "OSSRH_PROFILE_ID={ossrh-profile-id}"
241             - shell: !include-raw-escape: ../shell/maven-central.sh
242             - lf-provide-maven-settings-cleanup
243
244 - builder:
245     name: lf-packagecloud-file-provider
246     builders:
247       - config-file-provider:
248           files:
249             - file-id: ".packagecloud"
250               target: "$HOME/.packagecloud"
251       - config-file-provider:
252           files:
253             - file-id: "packagecloud_api"
254               target: "$HOME/packagecloud_api"
255
256 - builder:
257     name: lf-packagecloud-push
258     builders:
259       - inject:
260           properties-content: |
261             BUILD_DIR={build-dir}
262             PACKAGECLOUD_ACCOUNT={packagecloud-account}
263             PACKAGECLOUD_REPO={packagecloud-repo}
264             DEBIAN_DISTRIBUTION_VERSIONS={debian-distribution-versions}
265             RPM_DISTRIBUTION_VERSIONS={rpm-distribution-versions}
266       - shell: !include-raw-escape: ../shell/packagecloud-push.sh
267
268 - builder:
269     name: lf-maven-install
270     builders:
271       # Create a $HOME/.wgetrc to make the Maven download quiet.
272       - shell: 'echo "quiet=on" > "$HOME/.wgetrc"'
273       - maven-target:
274           maven-version: "{mvn-version}"
275           goals: "--version"
276       - shell: 'rm "$HOME/.wgetrc"'
277
278 - builder:
279     name: lf-provide-maven-settings
280     builders:
281       - config-file-provider:
282           files:
283             - file-id: "{global-settings-file}"
284               variable: "GLOBAL_SETTINGS_FILE"
285             - file-id: "{settings-file}"
286               variable: "SETTINGS_FILE"
287
288 - builder:
289     name: lf-provide-maven-settings-cleanup
290     builders:
291       - shell: |
292           #!/bin/bash
293           set +e  # DO NOT cause build failure if any of the rm calls fail.
294
295           rm -f "$GLOBAL_SETTINGS_FILE" "$SETTINGS_FILE"
296
297           # In some cases we use the lf-provide-maven-settings macro to produce
298           # a "$HOME/.netrc" file containing credentials. Remove that file here
299           # too if it exists.
300           rm -f "$HOME/.netrc"
301
302           # DO NOT fail build if any of the above lines fail.
303           exit 0
304
305 - builder:
306     name: lf-rtd-trigger-build
307     builders:
308       - inject:
309           properties-content: |
310             RTD_BUILD_URL={rtd-build-url}
311             RTD_TOKEN={rtd-token}
312       - shell: !include-raw-escape: ../shell/rtd-trigger-build.sh
313
314 - builder:
315     name: lf-rtd-verify
316     builders:
317       - inject:
318           properties-content: |
319             DOC_DIR={doc-dir}
320             PYTHON={python-version}
321       - shell: !include-raw-escape: ../shell/tox-install.sh
322       - shell: !include-raw-escape: ../shell/rtd-verify.sh
323
324 - builder:
325     name: lf-rtdv3-build
326     builders:
327       - inject:
328           properties-content: |
329             DEFAULT_VERSION={default-version}
330       - shell: !include-raw-escape: ../shell/rtdv3.sh
331
332 - builder:
333     name: check-info-votes
334     builders:
335       - inject:
336           properties-content: JENKINS_SSH_CREDENTIAL={jenkins-ssh-credential}
337       - shell: !include-raw-escape: ../shell/check-info-votes.sh
338
339 - builder:
340     name: lf-release
341     builders:
342       - config-file-provider:
343           files:
344             - file-id: lftoolsini
345               target: "$HOME/.config/lftools/lftools.ini"
346       - shell: !include-raw-escape: ../shell/release-job.sh
347
348 - builder:
349     name: lf-sigul-sign-dir
350     # Requires that Jenkins be configured with SIGUL_BRIDGE_IP as a global
351     # Environment variable
352     builders:
353       - conditional-step:
354           condition-kind: boolean-expression
355           condition-expression: "{sign-artifacts}"
356           steps:
357             - config-file-provider:
358                 files:
359                   - file-id: sigul-config
360                     variable: SIGUL_CONFIG
361                   - file-id: sigul-password
362                     variable: SIGUL_PASSWORD
363                   - file-id: sigul-pki
364                     variable: SIGUL_PKI
365             - shell: !include-raw-escape: ../shell/sigul-configuration.sh
366             - shell: !include-raw-escape: ../shell/sigul-install.sh
367             - inject:
368                 properties-content: |
369                   SIGN_DIR={sign-dir}
370                   SIGN_MODE={sign-mode}
371             - shell: !include-raw-escape:
372                 - ../shell/sigul-sign-dir.sh
373             - shell: !include-raw-escape: ../shell/sigul-configuration-cleanup.sh
374
375 - builder:
376     name: lf-infra-provide-docker-cleanup
377     builders:
378       - shell: |
379           #!/bin/bash
380           set +e  # DO NOT cause build failure if docker rmi fails
381           docker rmi -f $(docker images -a -q)
382           exit 0
383
384 - builder:
385     name: lf-infra-sonar
386     # Run a Sonar Jenkins Plugin
387     builders:
388       - sonar:
389           sonar-name: Sonar
390           scanner-name: SonarQubeScanner
391           task: "{sonar-task}"
392           project: "{sonar-project-file}"
393           properties: "{sonar-properties}"
394           java-opts: "{sonar-java-opts}"
395           additional-arguments: "{sonar-additional-args}"
396           jdk: "{sonar-jdk}"
397
398 - builder:
399     name: lf-infra-sonar-with-prescan
400     # Run a Sonar Jenkins Plugin
401     builders:
402       - lf-sonar-prescan # Must be defined by caller
403       - sonar:
404           sonar-name: Sonar
405           scanner-name: SonarQubeScanner
406           task: "{sonar-task}"
407           project: "{sonar-project-file}"
408           properties: "{sonar-properties}"
409           java-opts: "{sonar-java-opts}"
410           additional-arguments: "{sonar-additional-args}"
411
412 - builder:
413     name: lf-infra-pipeline-verify
414     builders:
415       - shell: !include-raw-escape: ../shell/pipeline-linter.sh
416
417 ##############
418 # PARAMETERS #
419 ##############
420
421 - parameter:
422     name: lf-autotools-parameters
423     # Parameters for configure-make builds.
424     parameters:
425       - string:
426           name: CONFIGURE_OPTS
427           default: "{configure-opts}"
428           description: |
429             Options to pass to configure.
430             Example: --build=i686-pc-linux-gnu
431       - string:
432           name: INSTALL_PREFIX
433           default: "{install-prefix}"
434           description: |
435             Install prefix for configure.
436             Usually a workspace subdirectory.
437       - string:
438           name: MAKE_OPTS
439           default: "{make-opts}"
440           description: |
441             Options to pass to make.
442             Example: -j8 all
443
444 - parameter:
445     name: lf-clm-parameters
446     parameters:
447       - string:
448           name: NEXUS_IQ_STAGE
449           default: "{nexus-iq-stage}"
450           description: |
451             Stage the policy evaluation will be run against on the Nexus IQ Server.
452
453 - parameter:
454     name: lf-cmake-parameters
455     # Parameters useful in CMake builds.
456     parameters:
457       - string:
458           name: BUILD_DIR
459           default: "{build-dir}"
460           description: "Directory to build the project in."
461       - string:
462           name: CMAKE_OPTS
463           default: "{cmake-opts}"
464           description: |
465             Options to pass to CMAKE.
466             Example: -DCMAKE_INSTALL_PREFIX=$WORKSPACE/target/output
467       - string:
468           name: INSTALL_PREFIX
469           default: "{install-prefix}"
470           description: "Install prefix for C/C++ builds. Example: /usr/local"
471       - string:
472           name: MAKE_OPTS
473           default: "{make-opts}"
474           description: "Options to pass to make. Example: -j8"
475
476 - parameter:
477     name: lf-gerrit-event-comment-text-parameter
478     # GERRIT_EVENT_COMMENT_TEXT parameter is usually provided
479     # by the triggering gerrit comment.
480     # Having it as parameter is useful for "Build with parameters",
481     # for example when testing (otherwise gerrit comment triggered)
482     # jobs on Sandbox.
483     parameters:
484       - string:
485           name: GERRIT_EVENT_COMMENT_TEXT
486           default: "{comment-text}"
487           description: "Simulated gerrit comment when triggering manually."
488
489 - parameter:
490     name: lf-infra-maven-parameters
491     parameters:
492       - string:
493           name: M2_HOME
494           # Sets an env var for shell scripts to be able to call the dynamically
495           # installed maven without having to calculate the M2_HOME themselves.
496           default: "/w/tools/hudson.tasks.Maven_MavenInstallation/{mvn-version}"
497           description: "Maven selector to be used by shell scripts"
498       - string:
499           name: MAVEN_OPTS
500           default: "{mvn-opts}"
501           description: |
502             Maven Java opts. Example: -Xmx1024m -XX:MaxPermSize=256m
503       - string:
504           name: MAVEN_PARAMS
505           default: "{mvn-params}"
506           description: |
507             Maven parameters to pass to the mvn command.
508       - string:
509           name: MVN
510           # Sets an env var for shell scripts to be able to call the dynamically
511           # installed maven without having to calculate the path themselves.
512           # yamllint disable-line rule:line-length
513           default: "/w/tools/hudson.tasks.Maven_MavenInstallation/{mvn-version}/bin/mvn"
514           description: "Maven selector to be used by shell scripts"
515
516 - parameter:
517     name: lf-infra-openstack-parameters
518     parameters:
519       - string:
520           name: OS_CLOUD
521           default: "{os-cloud}"
522           description: |
523             The name of a cloud configuration in clouds.yaml. OS_CLOUD is a
524             variable name that is significant to openstack client as a
525             environment variable. Please refer to the documentation for
526             further details.
527             https://docs.openstack.org/developer/python-openstackclient/
528
529 - parameter:
530     name: lf-infra-parameters
531     # Standard parameters used in the LF CI environments. Gerrit variables are
532     # not used by GitHub projects, but defining them isn't harmful.
533     parameters:
534       - string:
535           name: PROJECT
536           default: "{project}"
537           description: |
538             Parameter to identify a SCM project to build. This is typically
539             the project repo path. For example: ofextensions/circuitsw
540       - string:
541           name: STREAM
542           default: "{stream}"
543           description: |
544             Stream is often set to the same name as 'branch' but can
545             sometimes be used as a name representing a project's release code
546             name.
547       - string:
548           name: GERRIT_PROJECT
549           default: "{project}"
550           description: |
551             Gerrit Trigger provided parameter to identify Gerrit project that
552             triggered the build. This is typically the project repo path as
553             exists in Gerrit. For example: ofextensions/circuitsw
554
555             If using Gerrit, in a manual build this should match the PROJECT
556             parameter above.
557       - string:
558           name: GERRIT_BRANCH
559           default: "{branch}"
560           description: |
561             Gerrit Trigger provided parameter to identify a Gerrit branch.
562
563             If using Gerrit, in a manual build override with the branch to
564             build against.
565       - string:
566           name: GERRIT_REFSPEC
567           default: "refs/heads/{branch}"
568           description: |
569             Gerrit Trigger provided parameter to identify a refspec to fetch
570             from Gerrit.
571
572             If using Gerrit, in a manual build override with a refspec.
573             https://git-scm.com/book/en/v2/Git-Internals-The-Refspec
574             For example: 'refs/heads/master'
575       - string:
576           name: sha1
577           default: "origin/{branch}"
578           description: |
579             GitHub PR Trigger provided parameter for specifying the commit
580             to checkout.
581
582             If using GitHub, in a manual build override with a branch path or
583             sha1 hash to a specific commit. For example: 'origin/master'
584
585 - parameter:
586     name: lf-infra-node-parameters
587     parameters:
588       - string:
589           name: NODE_DIR
590           default: "{node-dir}"
591           description: Path to a Node project directory.
592       - string:
593           name: NODE_VERSION
594           default: "{node-version}"
595           description: Version of NodeJS to install.
596
597 - parameter:
598     name: lf-infra-sonar-cli-parameters
599     parameters:
600       - string:
601           name: TOX_DIR
602           default: "{tox-dir}"
603           description: |
604             Path to directory containing tox.ini file.
605       - string:
606           name: TOX_ENVS
607           default: "{tox-envs}"
608           description: |
609             Tox environments to run build against.
610       - string:
611           name: SONAR_SCANNER_VERSION
612           default: "{sonar-scanner-version}"
613           description: |
614             Version of sonar scanner to use.
615             Example: 4.7.0.2747
616       - string:
617           name: SONAR_SCANNER_HOME
618           default: "{sonar-scanner-home}"
619           description: |
620             Sonar scanner home directory.
621             Example: $WORKSPACE/.sonar/sonar-scanner-$SONAR_SCANNER_VERSION-linux
622       - string:
623           name: SONAR_SCANNER_OPTS
624           default: "{sonar-scanner-opts}"
625           description: |
626             Sonar scanner Java options.
627             Example: -server
628
629 - parameter:
630     name: lf-infra-tox-parameters
631     parameters:
632       - string:
633           name: TOX_DIR
634           default: "{tox-dir}"
635           description: |
636             Path to directory containing tox.ini file.
637       - string:
638           name: TOX_ENVS
639           default: "{tox-envs}"
640           description: |
641             Tox environments to run build against.
642             Example: docs,py3
643
644 - parameter:
645     name: lf-build-with-parameters-maven-release
646     parameters:
647       - string:
648           name: VERSION
649           default: ""
650           description: "Version to release, for example: 1.0.0"
651       - string:
652           name: GIT_TAG
653           default: ""
654           description: "Tag to push to git repo; optional, defaults to VERSION"
655       - string:
656           name: LOG_DIR
657           default: ""
658           description: "Log dir, for example: project-maven-stage-master/17/"
659       - string:
660           name: OVERRIDE_SEMVER_REGEX
661           default: ""
662           description: "Override Semantic Version (SemVer) Regular Expression. Ex: '.*'"
663       - choice:
664           name: DISTRIBUTION_TYPE
665           choices:
666             - None
667             - container
668             - maven
669           description: "Set to maven for build with parameters"
670       - bool:
671           name: USE_RELEASE_FILE
672           default: "{use-release-file}"
673           description: "Set to False for job built with parameters"
674
675 ##############
676 # PROPERTIES #
677 ##############
678
679 - property:
680     name: lf-infra-properties
681     properties:
682       - build-discarder:
683           # Allow build data to be stored at a length configured by the
684           # downstream project.
685           days-to-keep: "{build-days-to-keep}"
686           # Do not allow artifacts to be stored in Jenkins.
687           artifact-num-to-keep: 0
688
689 ##############
690 # PUBLISHERS #
691 ##############
692
693 - publisher:
694     name: lf-jacoco-report
695     publishers:
696       - jacoco:
697           exec-pattern: "**/**.exec"
698           class-pattern: "**/classes"
699           source-pattern: "**/src/main/java"
700           # yamllint disable-line rule:line-length
701           exclusion-pattern: "{exclude-pattern}"
702           status-update: true
703           targets:
704             - branch:
705                 healthy: 10
706                 unhealthy: 20
707             - method:
708                 healthy: 50
709                 unhealthy: 40
710
711 - publisher:
712     name: lf-infra-publish
713     # lf-infra macro to finish up a build.
714     #
715     # Handles the following:
716     #   - Shipping logs to Nexus logs site repository
717     #   - Cleanup workspace
718     publishers:
719       - postbuildscript:
720           builders:
721             - role: BOTH
722               build-on:
723                 - ABORTED
724                 - FAILURE
725                 - NOT_BUILT
726                 - SUCCESS
727                 - UNSTABLE
728               build-steps:
729                 - lf-infra-sysstat
730                 - lf-infra-package-listing
731                 - lf-infra-capture-instance-metadata
732                 - lf-infra-ship-logs
733           mark-unstable-if-failed: true
734       - workspace-cleanup:
735           exclude:
736             # Do not clean up *.jenkins-trigger files for jobs that use a
737             # properties file as input for triggering another build.
738             - "**/*.jenkins-trigger"
739           fail-build: false
740
741 - publisher:
742     name: lf-infra-publish-windows
743     # lf-infra macro to finish up a build.
744     #
745     # Handles the following:
746     #   - Shipping logs to Nexus logs site repository
747     #   - Cleanup workspace
748     publishers:
749       # TODO: RELENG-1228 Develop log shipping script for Windows systems
750       # - postbuildscript:
751       #     builders:
752       #       - role: BOTH
753       #         build-on:
754       #           - ABORTED
755       #           - FAILURE
756       #           - NOT_BUILT
757       #           - SUCCESS
758       #           - UNSTABLE
759       #         build-steps:
760       #           - lf-infra-ship-logs-windows
761       #     mark-unstable-if-failed: true
762       - workspace-cleanup:
763           exclude:
764             # Do not clean up *.jenkins-trigger files for jobs that use a
765             # properties file as input for triggering another build.
766             - "**/*.jenkins-trigger"
767           fail-build: false
768
769 - publisher:
770     name: global-jjb-email-notification
771     publishers:
772       - email-ext:
773           recipients: "{email-recipients}"
774           reply-to: ""
775           content-type: default
776           subject: "{email-prefix} $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS!"
777           body: |
778             $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS:
779
780             Please refer to the logs server URL for console logs when possible
781             and use the Jenkins Build URL as a last resort.
782
783             Jenkins Build URL:
784             $BUILD_URL
785           unstable: true
786           fixed: true
787           send-to:
788             - recipients
789
790 #######
791 # SCM #
792 #######
793
794 - scm:
795     name: lf-infra-gerrit-scm
796     scm:
797       - git:
798           credentials-id: "{jenkins-ssh-credential}"
799           url: "{git-url}"
800           refspec: "{refspec}"
801           branches:
802             - "refs/heads/{branch}"
803           skip-tag: true
804           wipe-workspace: true
805           submodule:
806             disable: "{submodule-disable}"
807             recursive: "{submodule-recursive}"
808             timeout: "{submodule-timeout}"
809           choosing-strategy: "{choosing-strategy}"
810
811 - scm:
812     name: lf-infra-github-scm
813     scm:
814       - git:
815           credentials-id: "{jenkins-ssh-credential}"
816           url: "{url}"
817           refspec: "{refspec}"
818           branches:
819             - "{branch}"
820           skip-tag: true
821           wipe-workspace: true
822           submodule:
823             disable: "{submodule-disable}"
824             recursive: "{submodule-recursive}"
825             timeout: "{submodule-timeout}"
826           choosing-strategy: "{choosing-strategy}"
827
828 ############
829 # WRAPPERS #
830 ############
831
832 - wrapper:
833     name: lf-infra-wrappers-common
834     wrappers:
835       - mask-passwords
836       - timeout:
837           type: absolute
838           timeout: "{build-timeout}"
839           timeout-var: "BUILD_TIMEOUT"
840           fail: true
841       - timestamps
842       - openstack:
843           single-use: true
844
845 - wrapper:
846     name: lf-infra-wrappers
847     wrappers:
848       - lf-infra-wrappers-common:
849           build-timeout: "{build-timeout}"
850       - config-file-provider:
851           files:
852             - file-id: npmrc
853               target: "$HOME/.npmrc"
854             - file-id: pipconf
855               target: "$HOME/.config/pip/pip.conf"
856       - ssh-agent-credentials:
857           users:
858             - "{jenkins-ssh-credential}"
859
860 - wrapper:
861     name: lf-infra-wrappers-windows
862     wrappers:
863       - lf-infra-wrappers-common:
864           build-timeout: "{build-timeout}"