Skip to content

Commit cecc96f

Browse files
committed
JAVA-2348: Add snapshot publishing support to Evergreen configuration
1 parent 94780bc commit cecc96f

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

.evergreen/.evg.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,14 @@ functions:
216216
${PREPARE_SHELL}
217217
AUTH=${AUTH} SSL=${SSL} MONGODB_URI="${MONGODB_URI}" TOPOLOGY=${TOPOLOGY} JDK="${JDK}" .evergreen/run-tests.sh
218218
219+
"publish snapshot":
220+
- command: shell.exec
221+
type: test
222+
params:
223+
working_dir: "src"
224+
script: |
225+
PROJECT_DIRECTORY=${PROJECT_DIRECTORY} NEXUS_USER=${sonatype_username} NEXUS_PWD=${sonatype_password} SIGNING_PWD=${signing_password} SIGNING_KEY_ID=${signing_keyId} RING_FILE_GPG_BASE64=${ring_file_gpg_base64} .evergreen/publish.sh
226+
219227
"cleanup":
220228
- command: shell.exec
221229
params:
@@ -310,6 +318,13 @@ tasks:
310318
- func: "bootstrap mongo-orchestration"
311319
- func: "run tests"
312320

321+
- name: publish-snapshot
322+
depends_on:
323+
- variant: ".tests-variant"
324+
name: "test"
325+
commands:
326+
- func: "publish snapshot"
327+
313328
axes:
314329
- id: version
315330
display_name: MongoDB Version
@@ -412,12 +427,21 @@ buildvariants:
412427
matrix_spec: { auth: "*", ssl: "*", jdk: "jdk6", version: "*", topology: "*", os: "*" }
413428
exclude_spec: { version: "2.4", ssl: "ssl", jdk: "*", auth: "*", topology: "*", os: "*" }
414429
display_name: "${version} ${topology} ${auth} ${ssl} ${jdk} ${os} "
430+
tags: ["tests-variant"]
415431
tasks:
416432
- name: "test"
417433

418434
- matrix_name: "tests-jdk-other"
419435
matrix_spec: { auth: "*", ssl: "*", jdk: "*", version: "latest", topology: "standalone", os: "rhel62" }
420436
exclude_spec: { jdk: "jdk6", auth: "*", ssl: "*", version: "*", topology: "*", os: "*" }
421437
display_name: "${version} ${topology} ${auth} ${ssl} ${jdk} ${os} "
438+
tags: ["tests-variant"]
422439
tasks:
423440
- name: "test"
441+
442+
- name: publish-snapshot
443+
display_name: "Publish Snapshot"
444+
run_on:
445+
- rhel62-test
446+
tasks:
447+
- name: "publish-snapshot"

.evergreen/publish.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
3+
# DO NOT ECHO COMMANDS AS THEY CONTAIN SECRETS!
4+
5+
set -o errexit # Exit the script with error if any of the commands fail
6+
7+
############################################
8+
# Main Program #
9+
############################################
10+
11+
echo ${RING_FILE_GPG_BASE64} | base64 -d > ${PROJECT_DIRECTORY}/secring.gpg
12+
13+
echo "Publishing snapshot with jdk8"
14+
15+
export JAVA_HOME="/opt/java/jdk8"
16+
./gradlew -version
17+
./gradlew -PnexusUsername=${NEXUS_USER} -PnexusPassword=${NEXUS_PWD} -Psigning.secretKeyRingFile=${PROJECT_DIRECTORY}/secring.gpg -Psigning.password=${SIGNING_PWD} -Psigning.keyId=${SIGNING_KEY_ID} uploadSnapshotArchives --info

0 commit comments

Comments
 (0)