Skip to content

Commit 3a5175c

Browse files
committed
JAVA-2348: Add snapshot publishing support to Evergreen configuration
1 parent 14a512f commit 3a5175c

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
@@ -408,12 +423,21 @@ buildvariants:
408423
matrix_spec: { auth: "*", ssl: "*", jdk: "jdk6", version: "*", topology: "*", os: "*" }
409424
exclude_spec: { version: "2.4", ssl: "ssl", jdk: "*", auth: "*", topology: "*", os: "*" }
410425
display_name: "${version} ${topology} ${auth} ${ssl} ${jdk} ${os} "
426+
tags: ["tests-variant"]
411427
tasks:
412428
- name: "test"
413429

414430
- matrix_name: "tests-jdk-other"
415431
matrix_spec: { auth: "*", ssl: "*", jdk: "*", version: "3.4", topology: "standalone", os: "rhel62" }
416432
exclude_spec: { jdk: "jdk6", auth: "*", ssl: "*", version: "*", topology: "*", os: "*" }
417433
display_name: "${version} ${topology} ${auth} ${ssl} ${jdk} ${os} "
434+
tags: ["tests-variant"]
418435
tasks:
419436
- name: "test"
437+
438+
- name: publish-snapshot
439+
display_name: "Publish Snapshot"
440+
run_on:
441+
- rhel62-test
442+
tasks:
443+
- 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)