blob: 5287127e7bac724c8d627e686cb8ae4c06441236 [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:
Kailash Khalasi45f4e2c2018-05-09 14:09:50 -07005 id: maven-install
6 name: '{project}-gerrit'
Kailash Khalasi69c8fcd2018-05-09 09:43:49 -07007 description: |
8 <!-- Managed by Jenkins Job Builder -->
Kailash Khalasi45f4e2c2018-05-09 14:09:50 -07009 Created by {id} job-template from ci-management/jjb/maven.yaml
Kailash Khalasi69c8fcd2018-05-09 09:43:49 -070010
11 node: 'ubuntu16.04-basebuild-1c-2g'
Matteo Scandolo00240382018-11-26 14:42:32 -080012 project-type: freestyle
Kailash Khalasi69c8fcd2018-05-09 09:43:49 -070013
Kailash Khalasif3f15bd2018-05-09 09:58:52 -070014 parameters:
15 - string:
Kailash Khalasia5ca0c72018-05-09 12:00:21 -070016 name: GERRIT_BRANCH
17 default: 'master'
Kailash Khalasif3f15bd2018-05-09 09:58:52 -070018 description: 'Use default when using "Build Now"'
19
20 - string:
Kailash Khalasia5ca0c72018-05-09 12:00:21 -070021 name: GERRIT_REFSPEC
22 default: 'refs/heads/master'
Kailash Khalasif3f15bd2018-05-09 09:58:52 -070023 description: 'Use default when using "Build Now"'
24
Zack Williams234dc922019-08-30 17:03:57 -070025 - string:
26 name: jdkDistro
27 default: '{jdk-distribution}'
28 description: 'Distribution of the JDK to use with update-java-alternatives'
29
Kailash Khalasi69c8fcd2018-05-09 09:43:49 -070030 triggers:
31 - cord-infra-gerrit-trigger-patchset:
32 gerrit-server-name: '{gerrit-server-name}'
Kailash Khalasi45f4e2c2018-05-09 14:09:50 -070033 project-regexp: '{project}'
Kailash Khalasi69c8fcd2018-05-09 09:43:49 -070034 branch-regexp: '{branch-regexp}'
35 file-include-regexp: '{all-files-regexp}'
36 dependency-jobs: '{dependency-jobs}'
37
38 properties:
39 - cord-infra-properties:
40 build-days-to-keep: '{build-days-to-keep}'
41 artifact-num-to-keep: '{artifact-num-to-keep}'
Kailash Khalasia5ca0c72018-05-09 12:00:21 -070042
43 scm:
44 - git:
Kailash Khalasi45f4e2c2018-05-09 14:09:50 -070045 url: '{gerrit-server-url}/{project}'
Kailash Khalasi1b3d3fe2018-05-09 13:20:22 -070046 branches:
47 - '$GERRIT_BRANCH'
Kailash Khalasi45f4e2c2018-05-09 14:09:50 -070048 refspec: '$GERRIT_REFSPEC'
Kailash Khalasia5ca0c72018-05-09 12:00:21 -070049 choosing-strategy: 'gerrit'
Kailash Khalasia5ca0c72018-05-09 12:00:21 -070050 shallow-clone: true
Zack Williamsc3c83932018-10-30 13:56:37 -070051
Matteo Scandolo00240382018-11-26 14:42:32 -080052 builders:
53 # NOTE: this env var is only required to fix a bug in the "surefire" dependency:
54 # https://issues.apache.org/jira/browse/SUREFIRE-1588
55 # https://github.com/apache/maven-surefire/pull/197
56 # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=911925
57 # should be removed as soon as this problem is resolved
58 - inject:
59 properties-content: |
60 _JAVA_OPTIONS=-Djdk.net.URLClassPath.disableClassPathURLCheck=true
Zack Williams234dc922019-08-30 17:03:57 -070061
62 - shell: |
63 #!/usr/bin/env bash
64 set -eu -o pipefail
65 echo "Setting JDK Distro to: $jdkDistro"
Zack Williamsbfe83862019-09-19 22:18:04 -070066 sudo update-java-alternatives -s $jdkDistro
Zack Williams234dc922019-08-30 17:03:57 -070067 echo "Java Version:"
68 java -version
69
Matteo Scandolo00240382018-11-26 14:42:32 -080070 - maven-target:
71 pom: pom.xml
72 goals: 'clean install'
73
Matteo Scandolo23cde382019-05-22 17:00:43 -070074- job-template:
75 id: maven-deploy
76 name: '{project}-gerrit-deploy'
77 description: |
78 <!-- Managed by Jenkins Job Builder -->
79 Created by {id} job-template from ci-management/jjb/maven.yaml
80
81 node: 'ubuntu16.04-basebuild-1c-2g'
82 project-type: freestyle
83
84 parameters:
85 - string:
86 name: GERRIT_BRANCH
87 default: 'master'
88 description: 'Use default when using "Build Now"'
89
90 - string:
91 name: GERRIT_REFSPEC
92 default: 'refs/heads/master'
93 description: 'Use default when using "Build Now"'
94
Zack Williams234dc922019-08-30 17:03:57 -070095 - string:
96 name: jdkDistro
97 default: '{jdk-distribution}'
98 description: 'Distribution of the JDK to use with update-java-alternatives'
99
Matteo Scandolo23cde382019-05-22 17:00:43 -0700100 triggers:
101 - cord-infra-gerrit-trigger-merge:
102 gerrit-server-name: '{gerrit-server-name}'
103 project-regexp: '{project}'
104 branch-regexp: '{branch-regexp}'
105 file-include-regexp: '{all-files-regexp}'
106 dependency-jobs: '{dependency-jobs}'
107
108 properties:
109 - cord-infra-properties:
110 build-days-to-keep: '{build-days-to-keep}'
111 artifact-num-to-keep: '{artifact-num-to-keep}'
112
113 scm:
114 - git:
115 url: '{gerrit-server-url}/{project}'
116 branches:
117 - '$GERRIT_BRANCH'
118 refspec: '$GERRIT_REFSPEC'
119 choosing-strategy: 'gerrit'
120 shallow-clone: true
121
122 builders:
123 - inject:
124 properties-content: |
125 _JAVA_OPTIONS=-Djdk.net.URLClassPath.disableClassPathURLCheck=true
Zack Williams234dc922019-08-30 17:03:57 -0700126
127 - shell: |
128 #!/usr/bin/env bash
129 set -eu -o pipefail
130 echo "Setting JDK Distro to: $jdkDistro"
Zack Williamsbfe83862019-09-19 22:18:04 -0700131 sudo update-java-alternatives -s $jdkDistro
Zack Williams234dc922019-08-30 17:03:57 -0700132 echo "Java Version:"
133 java -version
134
Matteo Scandolo23cde382019-05-22 17:00:43 -0700135 - maven-target:
136 pom: pom.xml
137 settings: onoscord-apps
Matteo Scandoloe7ee33c2019-05-23 13:23:13 -0700138 settings-type: cfp
Matteo Scandolo23cde382019-05-22 17:00:43 -0700139 goals: 'clean deploy'
Zack Williamsc3c83932018-10-30 13:56:37 -0700140
141- job-template:
142 id: maven-test
143 name: 'verify_{project}_maven-test'
144 description: |
145 <!-- Managed by Jenkins Job Builder -->
146 Created by {id} job-template from ci-management/jjb/maven.yaml
147
Zack Williams234dc922019-08-30 17:03:57 -0700148 parameters:
149 - string:
150 name: jdkDistro
151 default: '{jdk-distribution}'
152 description: 'Distribution of the JDK to use with update-java-alternatives'
153
Zack Williamsc3c83932018-10-30 13:56:37 -0700154 triggers:
155 - cord-infra-gerrit-trigger-patchset:
156 gerrit-server-name: '{gerrit-server-name}'
157 project-regexp: '{project}'
158 branch-regexp: '{branch-regexp}'
159 file-include-regexp: '{all-files-regexp}'
160 dependency-jobs: '{dependency-jobs}'
161
162 properties:
163 - cord-infra-properties:
164 build-days-to-keep: '{build-days-to-keep}'
165 artifact-num-to-keep: '{artifact-num-to-keep}'
166
167
168 wrappers:
169 - lf-infra-wrappers:
170 build-timeout: 30
171 jenkins-ssh-credential: '{jenkins-ssh-credential}'
172
173 scm:
174 - lf-infra-gerrit-scm:
175 git-url: '$GIT_URL/$GERRIT_PROJECT'
176 refspec: '$GERRIT_REFSPEC'
177 branch: '$GERRIT_BRANCH'
178 submodule-recursive: 'false'
179 choosing-strategy: gerrit
180 jenkins-ssh-credential: '{jenkins-ssh-credential}'
181
182 node: 'ubuntu16.04-basebuild-1c-2g'
183 project-type: maven
184 concurrent: true
185
Matteo Scandolo00240382018-11-26 14:42:32 -0800186 builders:
187 # NOTE: this env var is only required to fix a bug in the "surefire" dependency:
188 # https://issues.apache.org/jira/browse/SUREFIRE-1588
189 # https://github.com/apache/maven-surefire/pull/197
190 # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=911925
191 # should be removed as soon as this problem is resolved
192 - inject:
193 properties-content: |
194 _JAVA_OPTIONS=-Djdk.net.URLClassPath.disableClassPathURLCheck=true
Zack Williams234dc922019-08-30 17:03:57 -0700195
196 - shell: |
197 #!/usr/bin/env bash
198 set -eu -o pipefail
199 echo "Setting JDK Distro to: $jdkDistro"
Zack Williamsbfe83862019-09-19 22:18:04 -0700200 sudo update-java-alternatives -s $jdkDistro
Zack Williams234dc922019-08-30 17:03:57 -0700201 echo "Java Version:"
202 java -version
203
Matteo Scandolo00240382018-11-26 14:42:32 -0800204 - maven-target:
205 pom: pom.xml
206 goals: 'test'