forked from mongodb/mongo-jdbc-driver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.evg.yml
387 lines (346 loc) · 11.6 KB
/
.evg.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
stepback: true
command_type: system
pre:
- func: "fetch source"
- func: "export variables"
post:
- func: "upload jar file"
- func: "upload unit test classes"
- func: "upload integration test classes"
- func: "upload unit test packages"
- func: "upload integration test packages"
- func: "upload unit test js"
- func: "upload integration test js"
- func: "upload unit test css "
- func: "upload integration test css "
- func: "upload unit test index"
- func: "upload integration test index"
- func: "upload xunit test results"
buildvariants:
- name: static-analysis
display_name: "Static Analysis"
run_on: [ ubuntu2004-test ]
tasks:
- spotless
- name: ubuntu1804-64-jdk-8
display_name: Ubuntu 18.04 jdk-8
expansions:
_platform: ubuntu1804-64-jdk-8
run_on: ubuntu1804-large
tasks:
- name: "build"
- name: "test-unit"
- name: "test-integration"
- name: release
display_name: "Release"
expansions:
_platform: ubuntu1804-64-jdk-8
run_on: ubuntu1804-build
tasks:
- name: "test-smoke"
- name: "publish-maven"
tasks:
- name: "build"
commands:
- func: "build jdbc driver"
- name: "test-unit"
commands:
- func: "run unit test"
- name: "test-integration"
commands:
- func: "run integration test"
- name: "test-smoke"
commands:
- func: "run smoke test"
- name: "publish-maven"
depends_on:
- name: "test-smoke"
variant: "release"
commands:
- func: "publish maven"
- name: spotless
commands:
- func: "check spotless"
functions:
"build jdbc driver":
command: shell.exec
type: test
params:
working_dir: mongo-jdbc-driver
script: |
${PREPARE_SHELL}
./gradlew clean -x test -x integrationTest spotlessApply build --rerun-tasks
"check spotless":
command: shell.exec
type: test
params:
working_dir: mongo-jdbc-driver
script: |
${PREPARE_SHELL}
./gradlew spotlessCheck
"run unit test":
command: shell.exec
type: test
params:
working_dir: mongo-jdbc-driver
script: |
${PREPARE_SHELL}
./gradlew clean test
"run integration test":
command: shell.exec
type: test
params:
working_dir: mongo-jdbc-driver
script: |
${PREPARE_SHELL}
./resources/run_adl.sh start &&
./gradlew runDataLoader &&
./gradlew clean integrationTest -x test
EXITCODE=$?
./resources/run_adl.sh stop
exit $EXITCODE
"run smoke test":
command: shell.exec
type: test
params:
working_dir: mongo-jdbc-driver
script: |
${PREPARE_SHELL}
./resources/run_adl.sh start &&
./gradlew runDataLoader &&
./gradlew clean shadowJar &&
./gradlew :smoketest:test -Psmoketest
EXITCODE=$?
./resources/run_adl.sh stop
exit $EXITCODE
"export variables":
- command: shell.exec
params:
working_dir: mongo-jdbc-driver
script: |
# set the state needed irrespective of _platform
ARTIFACTS_DIR=artifacts
S3_ARTIFACTS_DIR='adl-sql-driver/artifacts/${version_id}/${build_variant}'
S3_RELEASES_DIR='adl-sql-driver/releases/${version_id}/${build_variant}'
# get the version from the gradle.properties file, so we don't need to update in two places.
MDBJDBC_VER="$(cat "gradle.properties" | head -n 1 | sed s'/version\s*=\s*//')"
case '${_platform}' in
ubuntu1804-64-jdk-8)
JAVA_HOME=/opt/java/jdk8
;;
ubuntu1804-64-jdk-11)
JAVA_HOME=/opt/java/jdk11
;;
*)
echo "ERROR: invalid value for \${_platform}: '$_platform'"
echo "Allowed values: 'ubuntu1604-64-jdk-8', 'ubuntu1604-64-jdk-11'"
exit 1
;;
esac
# export any environment variables that will be needed by subprocesses
export PROJECT_DIRECTORY="$(pwd)"
# dump env, but redact S3_KEY and S3_SECRET.
echo '****************************ENV******************************'
env | sed 's/S3_SECRET=.*$/REDACTED/' | sed 's/S3_KEY=.*$/REDACTED/'
echo '*************************************************************'
# create expansions from values calculated above
mkdir -p $ARTIFACTS_DIR
cat <<EOT > $ARTIFACTS_DIR/expansions.yml
S3_ARTIFACTS_DIR: "$S3_ARTIFACTS_DIR"
S3_RELEASES_DIR: "$S3_RELEASES_DIR"
MDBJDBC_VER: "$MDBJDBC_VER"
JAVA_HOME: "$JAVA_HOME"
PREPARE_SHELL: |
export ADL_TEST_LOCAL_USER=${adl_test_local_user}
export ADL_TEST_LOCAL_PWD=${adl_test_local_pwd}
export ADL_TEST_LOCAL_HOST=${adl_test_local_host}
export ADL_TEST_LOCAL_AUTH_DB=${adl_test_local_auth_db}
export MDB_TEST_LOCAL_PORT=${mdb_test_local_port}
export ADL_TEST_USER=${adl_test_user}
export ADL_TEST_PWD=${adl_test_pwd}
export ADL_TEST_HOST=${adl_test_host}
export ADL_TEST_AUTH_DB=${adl_test_auth_db}
export JAVA_HOME=${JAVA_HOME}
export PROJECT_DIRECTORY=${PROJECT_DIRECTORY}
EOT
- command: expansions.update
params:
file: mongo-jdbc-driver/artifacts/expansions.yml
"fetch jdbc files":
- command: s3.get
params:
working_dir: mongo-jdbc-driver
aws_key: ${aws_key}
aws_secret: ${aws_secret}
local_file: mongo-jdbc-driver/build/libs/mongodb-jdbc-${MDBJDBC_VER}.jar
remote_file: ${S3_ARTIFACTS_DIR}/mongodb-jdbc-${MDBJDBC_VER}.jar
bucket: mciuploads
"fetch source":
- command: shell.exec
params:
silent: true
script: |
rm -rf mongo-jdbc-driver
- command: git.get_project
params:
directory: mongo-jdbc-driver
"upload unit test classes":
- command: s3.put
params:
silent: true
aws_key: ${aws_key}
aws_secret: ${aws_secret}
local_files_include_filter:
- mongo-jdbc-driver/build/reports/tests/test/classes/*.html
remote_file: ${S3_ARTIFACTS_DIR}/test/classes/
content_type: text/html
bucket: mciuploads
permissions: public-read
display_name: "Unit Test Classes"
visibility: none
"upload integration test classes":
- command: s3.put
params:
silent: true
aws_key: ${aws_key}
aws_secret: ${aws_secret}
local_files_include_filter:
- mongo-jdbc-driver/build/reports/tests/integrationTest/classes/*.html
remote_file: ${S3_ARTIFACTS_DIR}/integrationTest/classes/
content_type: text/html
bucket: mciuploads
permissions: public-read
display_name: "Integration Test Classes"
visibility: none
"upload unit test packages":
- command: s3.put
params:
silent: true
aws_key: ${aws_key}
aws_secret: ${aws_secret}
local_files_include_filter:
- mongo-jdbc-driver/build/reports/tests/test/packages/*.html
remote_file: ${S3_ARTIFACTS_DIR}/test/packages/
content_type: text/html
bucket: mciuploads
permissions: public-read
display_name: "Unit Test Packages"
visibility: none
"upload integration test packages":
- command: s3.put
params:
silent: true
aws_key: ${aws_key}
aws_secret: ${aws_secret}
local_files_include_filter:
- mongo-jdbc-driver/build/reports/tests/integrationTest/packages/*.html
remote_file: ${S3_ARTIFACTS_DIR}/integrationTest/packages/
content_type: text/html
bucket: mciuploads
permissions: public-read
display_name: "Integration Test Packages"
visibility: none
"upload unit test index":
- command: s3.put
params:
silent: true
aws_key: ${aws_key}
aws_secret: ${aws_secret}
local_file: mongo-jdbc-driver/build/reports/tests/test/index.html
remote_file: ${S3_ARTIFACTS_DIR}/test/index.html
content_type: text/html
bucket: mciuploads
permissions: public-read
display_name: "Unit Test Results"
"upload integration test index":
- command: s3.put
params:
silent: true
aws_key: ${aws_key}
aws_secret: ${aws_secret}
local_file: mongo-jdbc-driver/build/reports/tests/integrationTest/index.html
remote_file: ${S3_ARTIFACTS_DIR}/integrationTest/index.html
content_type: text/html
bucket: mciuploads
permissions: public-read
display_name: "Integration Test Results"
"upload unit test css ":
- command: s3.put
params:
silent: true
aws_key: ${aws_key}
aws_secret: ${aws_secret}
local_files_include_filter:
- mongo-jdbc-driver/build/reports/tests/test/css/*.css
remote_file: ${S3_ARTIFACTS_DIR}/test/css/
content_type: text/css
bucket: mciuploads
permissions: public-read
display_name: "Unit Test CSS"
visibility: none
"upload integration test css ":
- command: s3.put
params:
silent: true
aws_key: ${aws_key}
aws_secret: ${aws_secret}
local_files_include_filter:
- mongo-jdbc-driver/build/reports/tests/integrationTest/css/*.css
remote_file: ${S3_ARTIFACTS_DIR}/integrationTest/css/
content_type: text/css
bucket: mciuploads
permissions: public-read
display_name: "Integration Test CSS"
visibility: none
"upload unit test js":
- command: s3.put
params:
silent: true
aws_key: ${aws_key}
aws_secret: ${aws_secret}
local_files_include_filter:
- mongo-jdbc-driver/build/reports/tests/test/js/*.js
remote_file: ${S3_ARTIFACTS_DIR}/test/js/
content_type: application/javascript
bucket: mciuploads
permissions: public-read
display_name: "Unit Test JS"
visibility: none
"upload integration test js":
- command: s3.put
params:
silent: true
aws_key: ${aws_key}
aws_secret: ${aws_secret}
local_files_include_filter:
- mongo-jdbc-driver/build/reports/tests/integrationTest/js/*.js
remote_file: ${S3_ARTIFACTS_DIR}/integrationTest/js/
content_type: application/javascript
bucket: mciuploads
permissions: public-read
display_name: "Integration Test JS"
visibility: none
"upload xunit test results":
- command: attach.xunit_results
params:
silent: true
file: mongo-jdbc-driver/build/test-results/*/TEST-*.xml
"upload jar file":
- command: s3.put
params:
silent: true
aws_key: ${aws_key}
aws_secret: ${aws_secret}
local_file: mongo-jdbc-driver/build/libs/mongodb-jdbc-${MDBJDBC_VER}.jar
remote_file: ${S3_ARTIFACTS_DIR}/mongodb-jdbc-${MDBJDBC_VER}.jar
content_type: application/java-archive
bucket: mciuploads
permissions: public-read
display_name: "JDBC Driver (.jar)"
"publish maven":
- command: shell.exec
type: test
params:
working_dir: mongo-jdbc-driver
script: |
PROJECT_DIRECTORY="$(pwd)" NEXUS_PROFILE_ID=${NEXUS_PROFILE_ID} NEXUS_USERNAME=${NEXUS_USERNAME} NEXUS_PASSWORD=${NEXUS_PASSWORD} NEXUS_URL=${NEXUS_URL} SIGNING_PASSWORD=${SIGNING_PASSWORD} SIGNING_KEY_ID=${SIGNING_KEY_ID} RING_FILE_GPG_BASE64=${RING_FILE_GPG_BASE64} ./gradle/publish.sh