Feat!: Upgrade Jenkins-job-builder to 6x
[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-infra-maven-parameters
478     parameters:
479       - string:
480           name: M2_HOME
481           # Sets an env var for shell scripts to be able to call the dynamically
482           # installed maven without having to calculate the M2_HOME themselves.
483           default: "/w/tools/hudson.tasks.Maven_MavenInstallation/{mvn-version}"
484           description: "Maven selector to be used by shell scripts"
485       - string:
486           name: MAVEN_OPTS
487           default: "{mvn-opts}"
488           description: |
489             Maven Java opts. Example: -Xmx1024m -XX:MaxPermSize=256m
490       - string:
491           name: MAVEN_PARAMS
492           default: "{mvn-params}"
493           description: |
494             Maven parameters to pass to the mvn command.
495       - string:
496           name: MVN
497           # Sets an env var for shell scripts to be able to call the dynamically
498           # installed maven without having to calculate the path themselves.
499           # yamllint disable-line rule:line-length
500           default: "/w/tools/hudson.tasks.Maven_MavenInstallation/{mvn-version}/bin/mvn"
501           description: "Maven selector to be used by shell scripts"
502
503 - parameter:
504     name: lf-infra-openstack-parameters
505     parameters:
506       - string:
507           name: OS_CLOUD
508           default: "{os-cloud}"
509           description: |
510             The name of a cloud configuration in clouds.yaml. OS_CLOUD is a
511             variable name that is significant to openstack client as a
512             environment variable. Please refer to the documentation for
513             further details.
514             https://docs.openstack.org/developer/python-openstackclient/
515
516 - parameter:
517     name: lf-infra-parameters
518     # Standard parameters used in the LF CI environments. Gerrit variables are
519     # not used by GitHub projects, but defining them isn't harmful.
520     parameters:
521       - string:
522           name: PROJECT
523           default: "{project}"
524           description: |
525             Parameter to identify a SCM project to build. This is typically
526             the project repo path. For example: ofextensions/circuitsw
527       - string:
528           name: STREAM
529           default: "{stream}"
530           description: |
531             Stream is often set to the same name as 'branch' but can
532             sometimes be used as a name representing a project's release code
533             name.
534       - string:
535           name: GERRIT_PROJECT
536           default: "{project}"
537           description: |
538             Gerrit Trigger provided parameter to identify Gerrit project that
539             triggered the build. This is typically the project repo path as
540             exists in Gerrit. For example: ofextensions/circuitsw
541
542             If using Gerrit, in a manual build this should match the PROJECT
543             parameter above.
544       - string:
545           name: GERRIT_BRANCH
546           default: "{branch}"
547           description: |
548             Gerrit Trigger provided parameter to identify a Gerrit branch.
549
550             If using Gerrit, in a manual build override with the branch to
551             build against.
552       - string:
553           name: GERRIT_REFSPEC
554           default: "refs/heads/{branch}"
555           description: |
556             Gerrit Trigger provided parameter to identify a refspec to fetch
557             from Gerrit.
558
559             If using Gerrit, in a manual build override with a refspec.
560             https://git-scm.com/book/en/v2/Git-Internals-The-Refspec
561             For example: 'refs/heads/master'
562       - string:
563           name: sha1
564           default: "origin/{branch}"
565           description: |
566             GitHub PR Trigger provided parameter for specifying the commit
567             to checkout.
568
569             If using GitHub, in a manual build override with a branch path or
570             sha1 hash to a specific commit. For example: 'origin/master'
571
572 - parameter:
573     name: lf-infra-node-parameters
574     parameters:
575       - string:
576           name: NODE_DIR
577           default: "{node-dir}"
578           description: Path to a Node project directory.
579       - string:
580           name: NODE_VERSION
581           default: "{node-version}"
582           description: Version of NodeJS to install.
583
584 - parameter:
585     name: lf-infra-sonar-cli-parameters
586     parameters:
587       - string:
588           name: TOX_DIR
589           default: "{tox-dir}"
590           description: |
591             Path to directory containing tox.ini file.
592       - string:
593           name: TOX_ENVS
594           default: "{tox-envs}"
595           description: |
596             Tox environments to run build against.
597       - string:
598           name: SONAR_SCANNER_VERSION
599           default: "{sonar-scanner-version}"
600           description: |
601             Version of sonar scanner to use.
602             Example: 4.7.0.2747
603       - string:
604           name: SONAR_SCANNER_HOME
605           default: "{sonar-scanner-home}"
606           description: |
607             Sonar scanner home directory.
608             Example: $WORKSPACE/.sonar/sonar-scanner-$SONAR_SCANNER_VERSION-linux
609       - string:
610           name: SONAR_SCANNER_OPTS
611           default: "{sonar-scanner-opts}"
612           description: |
613             Sonar scanner Java options.
614             Example: -server
615
616 - parameter:
617     name: lf-infra-tox-parameters
618     parameters:
619       - string:
620           name: TOX_DIR
621           default: "{tox-dir}"
622           description: |
623             Path to directory containing tox.ini file.
624       - string:
625           name: TOX_ENVS
626           default: "{tox-envs}"
627           description: |
628             Tox environments to run build against.
629             Example: docs,py3
630
631 - parameter:
632     name: lf-build-with-parameters-maven-release
633     parameters:
634       - string:
635           name: VERSION
636           default: ""
637           description: "Version to release, for example: 1.0.0"
638       - string:
639           name: GIT_TAG
640           default: ""
641           description: "Tag to push to git repo; optional, defaults to VERSION"
642       - string:
643           name: LOG_DIR
644           default: ""
645           description: "Log dir, for example: project-maven-stage-master/17/"
646       - string:
647           name: OVERRIDE_SEMVER_REGEX
648           default: ""
649           description: "Override Semantic Version (SemVer) Regular Expression. Ex: '.*'"
650       - choice:
651           name: DISTRIBUTION_TYPE
652           choices:
653             - None
654             - container
655             - maven
656           description: "Set to maven for build with parameters"
657       - bool:
658           name: USE_RELEASE_FILE
659           default: "{use-release-file}"
660           description: "Set to False for job built with parameters"
661
662 ##############
663 # PROPERTIES #
664 ##############
665
666 - property:
667     name: lf-infra-properties
668     properties:
669       - build-discarder:
670           # Allow build data to be stored at a length configured by the
671           # downstream project.
672           days-to-keep: "{build-days-to-keep}"
673           # Do not allow artifacts to be stored in Jenkins.
674           artifact-num-to-keep: 0
675
676 ##############
677 # PUBLISHERS #
678 ##############
679
680 - publisher:
681     name: lf-jacoco-report
682     publishers:
683       - jacoco:
684           exec-pattern: "**/**.exec"
685           class-pattern: "**/classes"
686           source-pattern: "**/src/main/java"
687           # yamllint disable-line rule:line-length
688           exclusion-pattern: "{exclude-pattern}"
689           status-update: true
690           targets:
691             - branch:
692                 healthy: 10
693                 unhealthy: 20
694             - method:
695                 healthy: 50
696                 unhealthy: 40
697
698 - publisher:
699     name: lf-infra-publish
700     # lf-infra macro to finish up a build.
701     #
702     # Handles the following:
703     #   - Shipping logs to Nexus logs site repository
704     #   - Cleanup workspace
705     publishers:
706       - postbuildscript:
707           builders:
708             - role: BOTH
709               build-on:
710                 - ABORTED
711                 - FAILURE
712                 - NOT_BUILT
713                 - SUCCESS
714                 - UNSTABLE
715               build-steps:
716                 - lf-infra-sysstat
717                 - lf-infra-package-listing
718                 - lf-infra-capture-instance-metadata
719                 - lf-infra-ship-logs
720           mark-unstable-if-failed: true
721       - workspace-cleanup:
722           exclude:
723             # Do not clean up *.jenkins-trigger files for jobs that use a
724             # properties file as input for triggering another build.
725             - "**/*.jenkins-trigger"
726           fail-build: false
727
728 - publisher:
729     name: lf-infra-publish-windows
730     # lf-infra macro to finish up a build.
731     #
732     # Handles the following:
733     #   - Shipping logs to Nexus logs site repository
734     #   - Cleanup workspace
735     publishers:
736       # TODO: RELENG-1228 Develop log shipping script for Windows systems
737       # - postbuildscript:
738       #     builders:
739       #       - role: BOTH
740       #         build-on:
741       #           - ABORTED
742       #           - FAILURE
743       #           - NOT_BUILT
744       #           - SUCCESS
745       #           - UNSTABLE
746       #         build-steps:
747       #           - lf-infra-ship-logs-windows
748       #     mark-unstable-if-failed: true
749       - workspace-cleanup:
750           exclude:
751             # Do not clean up *.jenkins-trigger files for jobs that use a
752             # properties file as input for triggering another build.
753             - "**/*.jenkins-trigger"
754           fail-build: false
755
756 - publisher:
757     name: global-jjb-email-notification
758     publishers:
759       - email-ext:
760           recipients: "{email-recipients}"
761           reply-to: ""
762           content-type: default
763           subject: "{email-prefix} $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS!"
764           body: |
765             $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS:
766
767             Please refer to the logs server URL for console logs when possible
768             and use the Jenkins Build URL as a last resort.
769
770             Jenkins Build URL:
771             $BUILD_URL
772           unstable: true
773           fixed: true
774           send-to:
775             - recipients
776
777 #######
778 # SCM #
779 #######
780
781 - scm:
782     name: lf-infra-gerrit-scm
783     scm:
784       - git:
785           credentials-id: "{jenkins-ssh-credential}"
786           url: "{git-url}"
787           refspec: "{refspec}"
788           branches:
789             - "refs/heads/{branch}"
790           skip-tag: true
791           wipe-workspace: true
792           submodule:
793             disable: "{submodule-disable}"
794             recursive: "{submodule-recursive}"
795             timeout: "{submodule-timeout}"
796           choosing-strategy: "{choosing-strategy}"
797
798 - scm:
799     name: lf-infra-github-scm
800     scm:
801       - git:
802           credentials-id: "{jenkins-ssh-credential}"
803           url: "{url}"
804           refspec: "{refspec}"
805           branches:
806             - "{branch}"
807           skip-tag: true
808           wipe-workspace: true
809           submodule:
810             disable: "{submodule-disable}"
811             recursive: "{submodule-recursive}"
812             timeout: "{submodule-timeout}"
813           choosing-strategy: "{choosing-strategy}"
814
815 ############
816 # WRAPPERS #
817 ############
818
819 - wrapper:
820     name: lf-infra-wrappers-common
821     wrappers:
822       - mask-passwords
823       - timeout:
824           type: absolute
825           timeout: "{build-timeout}"
826           timeout-var: "BUILD_TIMEOUT"
827           fail: true
828       - timestamps
829       - openstack:
830           single-use: true
831
832 - wrapper:
833     name: lf-infra-wrappers
834     wrappers:
835       - lf-infra-wrappers-common:
836           build-timeout: "{build-timeout}"
837       - config-file-provider:
838           files:
839             - file-id: npmrc
840               target: "$HOME/.npmrc"
841             - file-id: pipconf
842               target: "$HOME/.config/pip/pip.conf"
843       - ssh-agent-credentials:
844           users:
845             - "{jenkins-ssh-credential}"
846
847 - wrapper:
848     name: lf-infra-wrappers-windows
849     wrappers:
850       - lf-infra-wrappers-common:
851           build-timeout: "{build-timeout}"