blob: fc44abfe838847a41fa6c75ebdf9ca46af7ffbb5 [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}'
19 description: 'Distribution of the JDK to use with update-java-alternatives'
Zack Williams234dc922019-08-30 17:03:57 -070020
Kailash Khalasi69c8fcd2018-05-09 09:43:49 -070021 triggers:
22 - cord-infra-gerrit-trigger-patchset:
23 gerrit-server-name: '{gerrit-server-name}'
Kailash Khalasi45f4e2c2018-05-09 14:09:50 -070024 project-regexp: '{project}'
Kailash Khalasi69c8fcd2018-05-09 09:43:49 -070025 branch-regexp: '{branch-regexp}'
26 file-include-regexp: '{all-files-regexp}'
27 dependency-jobs: '{dependency-jobs}'
28
29 properties:
30 - cord-infra-properties:
31 build-days-to-keep: '{build-days-to-keep}'
32 artifact-num-to-keep: '{artifact-num-to-keep}'
Kailash Khalasia5ca0c72018-05-09 12:00:21 -070033
34 scm:
Zack Williams866ef3c2019-09-27 15:41:02 -070035 - lf-infra-gerrit-scm:
36 git-url: '$GIT_URL/$GERRIT_PROJECT'
Kailash Khalasi45f4e2c2018-05-09 14:09:50 -070037 refspec: '$GERRIT_REFSPEC'
Zack Williams866ef3c2019-09-27 15:41:02 -070038 branch: '$GERRIT_BRANCH'
Zack Williamsccc14742020-01-22 13:15:59 -070039 submodule-disable: '{submodule-disable}'
Zack Williams866ef3c2019-09-27 15:41:02 -070040 submodule-recursive: 'false'
Zack Williamsccc14742020-01-22 13:15:59 -070041 submodule-timeout: '{submodule-timeout}'
Zack Williams866ef3c2019-09-27 15:41:02 -070042 choosing-strategy: gerrit
43 jenkins-ssh-credential: '{jenkins-ssh-credential}'
Zack Williamsc3c83932018-10-30 13:56:37 -070044
Matteo Scandolo00240382018-11-26 14:42:32 -080045 builders:
Zack Williams866ef3c2019-09-27 15:41:02 -070046 # Set JDK version
Zack Williams234dc922019-08-30 17:03:57 -070047 - shell: |
48 #!/usr/bin/env bash
49 set -eu -o pipefail
50 echo "Setting JDK Distro to: $jdkDistro"
Zack Williamsbfe83862019-09-19 22:18:04 -070051 sudo update-java-alternatives -s $jdkDistro
Zack Williams234dc922019-08-30 17:03:57 -070052 echo "Java Version:"
53 java -version
54
Zack Williams866ef3c2019-09-27 15:41:02 -070055 # run tests and install
Matteo Scandolo00240382018-11-26 14:42:32 -080056 - maven-target:
57 pom: pom.xml
Matteo Scandolob9b70df2019-10-31 09:36:44 -070058 settings: 'cord-apps-maven-settings'
Zack Williams866ef3c2019-09-27 15:41:02 -070059 settings-type: cfp
Andrey Pozolotin7d4b1ab2020-08-14 23:57:40 +020060 goals: '-Pci-verify clean test install spotbugs:check'
Hung-Wei Chiubfa8fe32021-04-27 10:59:40 -070061 maven-version: '{maven-version}'
Zack Williams866ef3c2019-09-27 15:41:02 -070062
63 publishers:
64 - junit:
65 results: "**/TEST-*.xml"
66 allow-empty-results: '{junit-allow-empty-results}'
67 - cobertura:
68 report-file: "**/*coverage.xml"
69 targets:
70 - files:
71 healthy: 80
72 unhealthy: 0
73 failing: 0
74 - method:
75 healthy: 50
76 unhealthy: 0
77 failing: 0
Matteo Scandolo00240382018-11-26 14:42:32 -080078
Matteo Scandolo23cde382019-05-22 17:00:43 -070079- job-template:
Zack Williams866ef3c2019-09-27 15:41:02 -070080 id: maven-publish
81 name: 'maven-publish{name-extension}_{project}'
Matteo Scandolo714959f2022-06-29 09:53:30 -070082 sandbox: true
Matteo Scandolo23cde382019-05-22 17:00:43 -070083 description: |
84 <!-- Managed by Jenkins Job Builder -->
85 Created by {id} job-template from ci-management/jjb/maven.yaml
86
Hung-Wei Chiuf6cbde22021-04-22 22:15:23 -070087 node: 'ubuntu18.04-basebuild-1c-2g'
Matteo Scandolo23cde382019-05-22 17:00:43 -070088 project-type: freestyle
89
90 parameters:
91 - string:
hwchiu14f97852019-10-08 10:51:11 -070092 name: jdkDistro
93 default: '{jdk-distribution}'
94 description: 'Distribution of the JDK to use with update-java-alternatives'
Zack Williams234dc922019-08-30 17:03:57 -070095
Matteo Scandolo23cde382019-05-22 17:00:43 -070096 triggers:
97 - cord-infra-gerrit-trigger-merge:
98 gerrit-server-name: '{gerrit-server-name}'
99 project-regexp: '{project}'
100 branch-regexp: '{branch-regexp}'
101 file-include-regexp: '{all-files-regexp}'
102 dependency-jobs: '{dependency-jobs}'
103
104 properties:
105 - cord-infra-properties:
106 build-days-to-keep: '{build-days-to-keep}'
107 artifact-num-to-keep: '{artifact-num-to-keep}'
108
109 scm:
Matteo Scandolo9de9dcf2019-10-30 15:43:50 -0700110 - lf-infra-gerrit-scm:
Zack Williams866ef3c2019-09-27 15:41:02 -0700111 git-url: '$GIT_URL/$GERRIT_PROJECT'
Matteo Scandolo23cde382019-05-22 17:00:43 -0700112 refspec: '$GERRIT_REFSPEC'
Zack Williams866ef3c2019-09-27 15:41:02 -0700113 branch: '$GERRIT_BRANCH'
Zack Williamsccc14742020-01-22 13:15:59 -0700114 submodule-disable: '{submodule-disable}'
Zack Williams866ef3c2019-09-27 15:41:02 -0700115 submodule-recursive: 'false'
Zack Williamsccc14742020-01-22 13:15:59 -0700116 submodule-timeout: '{submodule-timeout}'
Zack Williams866ef3c2019-09-27 15:41:02 -0700117 choosing-strategy: gerrit
118 jenkins-ssh-credential: '{jenkins-ssh-credential}'
Matteo Scandolo23cde382019-05-22 17:00:43 -0700119
Zack Williams15cbd7e2019-10-30 13:01:39 -0700120 wrappers:
121 - credentials-binding:
Joey Armstrongaf679da2023-01-31 14:22:41 -0500122 - file:
Zack Williams15cbd7e2019-10-30 13:01:39 -0700123 credential-id: 'gpg-creds-maven'
124 variable: 'GNUPG'
125
Matteo Scandolo23cde382019-05-22 17:00:43 -0700126 builders:
Zack Williams866ef3c2019-09-27 15:41:02 -0700127 # Set JDK version
Zack Williams234dc922019-08-30 17:03:57 -0700128 - shell: |
129 #!/usr/bin/env bash
130 set -eu -o pipefail
131 echo "Setting JDK Distro to: $jdkDistro"
Zack Williamsbfe83862019-09-19 22:18:04 -0700132 sudo update-java-alternatives -s $jdkDistro
Zack Williams234dc922019-08-30 17:03:57 -0700133 echo "Java Version:"
134 java -version
Zack Williams15cbd7e2019-10-30 13:01:39 -0700135 echo "Unpacking GPG Keys"
136 tar -xvf $GNUPG -C ~
Zack Williams234dc922019-08-30 17:03:57 -0700137
Matteo Scandolo23cde382019-05-22 17:00:43 -0700138 - maven-target:
Matteo Scandolo9de9dcf2019-10-30 15:43:50 -0700139 pom: pom.xml
Matteo Scandolob9b70df2019-10-31 09:36:44 -0700140 settings: 'cord-apps-maven-settings'
Matteo Scandoloe7ee33c2019-05-23 13:23:13 -0700141 settings-type: cfp
Matteo Scandolo864e5a82019-10-31 10:27:17 -0700142 goals: '-Prelease clean deploy'
Hung-Wei Chiu77f71712021-04-29 10:07:02 -0700143 maven-version: '{maven-version}'