blob: 7c5c7129f8c5a6b50c6e29ad77bc855e61a357b1 [file] [log] [blame]
Kailash Khalasi69c8fcd2018-05-09 09:43:49 -07001---
Zack Williamsc3c83932018-10-30 13:56:37 -07002# maven jobs for Java projects
Kailash Khalasi69c8fcd2018-05-09 09:43:49 -07003
4- job-template:
Zack Williams866ef3c2019-09-27 15:41:02 -07005 id: maven-test
6 name: 'verify_{project}_maven-test{name-extension}'
Matteo Scandolo714959f2022-06-29 09:53:30 -07007 sandbox: true
Kailash Khalasi69c8fcd2018-05-09 09:43:49 -07008 description: |
9 <!-- Managed by Jenkins Job Builder -->
Kailash Khalasi45f4e2c2018-05-09 14:09:50 -070010 Created by {id} job-template from ci-management/jjb/maven.yaml
Kailash Khalasi69c8fcd2018-05-09 09:43:49 -070011
Hung-Wei Chiuf6cbde22021-04-22 22:15:23 -070012 node: 'ubuntu18.04-basebuild-1c-2g'
Matteo Scandolo00240382018-11-26 14:42:32 -080013 project-type: freestyle
Kailash Khalasi69c8fcd2018-05-09 09:43:49 -070014
Kailash Khalasif3f15bd2018-05-09 09:58:52 -070015 parameters:
16 - string:
hwchiu14f97852019-10-08 10:51:11 -070017 name: jdkDistro
18 default: '{jdk-distribution}'
Joey Armstrong1cc90292024-04-02 09:27:33 -040019 description: >
20 'Distribution of the JDK to use with update-java-alternatives'
Zack Williams234dc922019-08-30 17:03:57 -070021
Kailash Khalasi69c8fcd2018-05-09 09:43:49 -070022 triggers:
23 - cord-infra-gerrit-trigger-patchset:
24 gerrit-server-name: '{gerrit-server-name}'
Kailash Khalasi45f4e2c2018-05-09 14:09:50 -070025 project-regexp: '{project}'
Kailash Khalasi69c8fcd2018-05-09 09:43:49 -070026 branch-regexp: '{branch-regexp}'
27 file-include-regexp: '{all-files-regexp}'
28 dependency-jobs: '{dependency-jobs}'
29
30 properties:
31 - cord-infra-properties:
32 build-days-to-keep: '{build-days-to-keep}'
33 artifact-num-to-keep: '{artifact-num-to-keep}'
Kailash Khalasia5ca0c72018-05-09 12:00:21 -070034
35 scm:
Zack Williams866ef3c2019-09-27 15:41:02 -070036 - lf-infra-gerrit-scm:
37 git-url: '$GIT_URL/$GERRIT_PROJECT'
Kailash Khalasi45f4e2c2018-05-09 14:09:50 -070038 refspec: '$GERRIT_REFSPEC'
Zack Williams866ef3c2019-09-27 15:41:02 -070039 branch: '$GERRIT_BRANCH'
Zack Williamsccc14742020-01-22 13:15:59 -070040 submodule-disable: '{submodule-disable}'
Zack Williams866ef3c2019-09-27 15:41:02 -070041 submodule-recursive: 'false'
Zack Williamsccc14742020-01-22 13:15:59 -070042 submodule-timeout: '{submodule-timeout}'
Zack Williams866ef3c2019-09-27 15:41:02 -070043 choosing-strategy: gerrit
44 jenkins-ssh-credential: '{jenkins-ssh-credential}'
Zack Williamsc3c83932018-10-30 13:56:37 -070045
Matteo Scandolo00240382018-11-26 14:42:32 -080046 builders:
Zack Williams866ef3c2019-09-27 15:41:02 -070047 # Set JDK version
Zack Williams234dc922019-08-30 17:03:57 -070048 - shell: |
49 #!/usr/bin/env bash
50 set -eu -o pipefail
51 echo "Setting JDK Distro to: $jdkDistro"
Zack Williamsbfe83862019-09-19 22:18:04 -070052 sudo update-java-alternatives -s $jdkDistro
Zack Williams234dc922019-08-30 17:03:57 -070053 echo "Java Version:"
54 java -version
55
Zack Williams866ef3c2019-09-27 15:41:02 -070056 # run tests and install
Matteo Scandolo00240382018-11-26 14:42:32 -080057 - maven-target:
58 pom: pom.xml
Matteo Scandolob9b70df2019-10-31 09:36:44 -070059 settings: 'cord-apps-maven-settings'
Zack Williams866ef3c2019-09-27 15:41:02 -070060 settings-type: cfp
Andrey Pozolotin7d4b1ab2020-08-14 23:57:40 +020061 goals: '-Pci-verify clean test install spotbugs:check'
Hung-Wei Chiubfa8fe32021-04-27 10:59:40 -070062 maven-version: '{maven-version}'
Zack Williams866ef3c2019-09-27 15:41:02 -070063
64 publishers:
65 - junit:
66 results: "**/TEST-*.xml"
67 allow-empty-results: '{junit-allow-empty-results}'
68 - cobertura:
69 report-file: "**/*coverage.xml"
70 targets:
71 - files:
72 healthy: 80
73 unhealthy: 0
74 failing: 0
75 - method:
76 healthy: 50
77 unhealthy: 0
78 failing: 0
Matteo Scandolo00240382018-11-26 14:42:32 -080079
Matteo Scandolo23cde382019-05-22 17:00:43 -070080- job-template:
Zack Williams866ef3c2019-09-27 15:41:02 -070081 id: maven-publish
82 name: 'maven-publish{name-extension}_{project}'
Matteo Scandolo714959f2022-06-29 09:53:30 -070083 sandbox: true
Matteo Scandolo23cde382019-05-22 17:00:43 -070084 description: |
85 <!-- Managed by Jenkins Job Builder -->
86 Created by {id} job-template from ci-management/jjb/maven.yaml
87
Hung-Wei Chiuf6cbde22021-04-22 22:15:23 -070088 node: 'ubuntu18.04-basebuild-1c-2g'
Matteo Scandolo23cde382019-05-22 17:00:43 -070089 project-type: freestyle
90
91 parameters:
92 - string:
hwchiu14f97852019-10-08 10:51:11 -070093 name: jdkDistro
94 default: '{jdk-distribution}'
Joey Armstrong1cc90292024-04-02 09:27:33 -040095 description: >
96 'Distribution of the JDK to use with update-java-alternatives'
Zack Williams234dc922019-08-30 17:03:57 -070097
Matteo Scandolo23cde382019-05-22 17:00:43 -070098 triggers:
99 - cord-infra-gerrit-trigger-merge:
100 gerrit-server-name: '{gerrit-server-name}'
101 project-regexp: '{project}'
102 branch-regexp: '{branch-regexp}'
103 file-include-regexp: '{all-files-regexp}'
104 dependency-jobs: '{dependency-jobs}'
105
106 properties:
107 - cord-infra-properties:
108 build-days-to-keep: '{build-days-to-keep}'
109 artifact-num-to-keep: '{artifact-num-to-keep}'
110
111 scm:
Matteo Scandolo9de9dcf2019-10-30 15:43:50 -0700112 - lf-infra-gerrit-scm:
Zack Williams866ef3c2019-09-27 15:41:02 -0700113 git-url: '$GIT_URL/$GERRIT_PROJECT'
Matteo Scandolo23cde382019-05-22 17:00:43 -0700114 refspec: '$GERRIT_REFSPEC'
Zack Williams866ef3c2019-09-27 15:41:02 -0700115 branch: '$GERRIT_BRANCH'
Zack Williamsccc14742020-01-22 13:15:59 -0700116 submodule-disable: '{submodule-disable}'
Zack Williams866ef3c2019-09-27 15:41:02 -0700117 submodule-recursive: 'false'
Zack Williamsccc14742020-01-22 13:15:59 -0700118 submodule-timeout: '{submodule-timeout}'
Zack Williams866ef3c2019-09-27 15:41:02 -0700119 choosing-strategy: gerrit
120 jenkins-ssh-credential: '{jenkins-ssh-credential}'
Matteo Scandolo23cde382019-05-22 17:00:43 -0700121
Zack Williams15cbd7e2019-10-30 13:01:39 -0700122 wrappers:
123 - credentials-binding:
Joey Armstrongaf679da2023-01-31 14:22:41 -0500124 - file:
Joey Armstrong0895a882023-02-06 14:50:39 -0500125 credential-id: 'gpg-creds-maven'
126 variable: 'GNUPG'
Zack Williams15cbd7e2019-10-30 13:01:39 -0700127
Matteo Scandolo23cde382019-05-22 17:00:43 -0700128 builders:
Zack Williams866ef3c2019-09-27 15:41:02 -0700129 # Set JDK version
Zack Williams234dc922019-08-30 17:03:57 -0700130 - shell: |
131 #!/usr/bin/env bash
132 set -eu -o pipefail
133 echo "Setting JDK Distro to: $jdkDistro"
Zack Williamsbfe83862019-09-19 22:18:04 -0700134 sudo update-java-alternatives -s $jdkDistro
Zack Williams234dc922019-08-30 17:03:57 -0700135 echo "Java Version:"
136 java -version
Zack Williams15cbd7e2019-10-30 13:01:39 -0700137 echo "Unpacking GPG Keys"
138 tar -xvf $GNUPG -C ~
Zack Williams234dc922019-08-30 17:03:57 -0700139
Matteo Scandolo23cde382019-05-22 17:00:43 -0700140 - maven-target:
Matteo Scandolo9de9dcf2019-10-30 15:43:50 -0700141 pom: pom.xml
Matteo Scandolob9b70df2019-10-31 09:36:44 -0700142 settings: 'cord-apps-maven-settings'
Matteo Scandoloe7ee33c2019-05-23 13:23:13 -0700143 settings-type: cfp
Matteo Scandolo864e5a82019-10-31 10:27:17 -0700144 goals: '-Prelease clean deploy'
Hung-Wei Chiu77f71712021-04-29 10:07:02 -0700145 maven-version: '{maven-version}'