Skip to content

Commit

Permalink
Support publishing release builds in publish script used in Evergreen
Browse files Browse the repository at this point in the history
  • Loading branch information
jyemin committed Jul 29, 2020
1 parent 46c00b2 commit a53d0c7
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 6 deletions.
23 changes: 21 additions & 2 deletions .evergreen/.evg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -584,11 +584,19 @@ functions:
- command: shell.exec
type: test
params:
silent: true
working_dir: "src"
script: |
# DO NOT ECHO WITH XTRACE (which PREPARE_SHELL does)
PROJECT_DIRECTORY=${PROJECT_DIRECTORY} NEXUS_USERNAME=${nexus_username} NEXUS_PASSWORD=${nexus_password} SIGNING_PASSWORD=${signing_password} SIGNING_KEY_ID=${signing_keyId} RING_FILE_GPG_BASE64=${ring_file_gpg_base64} .evergreen/publish.sh
RELEASE=false PROJECT_DIRECTORY=${PROJECT_DIRECTORY} NEXUS_USERNAME=${nexus_username} NEXUS_PASSWORD=${nexus_password} SIGNING_PASSWORD=${signing_password} SIGNING_KEY_ID=${signing_keyId} RING_FILE_GPG_BASE64=${ring_file_gpg_base64} .evergreen/publish.sh
"publish release":
- command: shell.exec
type: test
params:
working_dir: "src"
script: |
# DO NOT ECHO WITH XTRACE (which PREPARE_SHELL does)
RELEASE=true PROJECT_DIRECTORY=${PROJECT_DIRECTORY} NEXUS_USERNAME=${nexus_username} NEXUS_PASSWORD=${nexus_password} SIGNING_PASSWORD=${signing_password} SIGNING_KEY_ID=${signing_keyId} RING_FILE_GPG_BASE64=${ring_file_gpg_base64} .evergreen/publish.sh
"cleanup":
- command: shell.exec
Expand Down Expand Up @@ -1155,6 +1163,11 @@ tasks:
commands:
- func: "publish snapshot"

- name: publish-release
git_tag_only: true
commands:
- func: "publish release"

- name: "perf"
tags: ["perf"]
commands:
Expand Down Expand Up @@ -1468,6 +1481,12 @@ buildvariants:
tasks:
- name: "publish-snapshot"

- name: publish-release
display_name: "Publish Release"
run_on: ubuntu1804-test
tasks:
- name: "publish-release"

- matrix_name: "tests-storage-engines"
matrix_spec: { auth: "noauth", ssl: "nossl", jdk: "jdk8", os: "linux", version: ["3.6", "4.0"], topology: ["replicaset", "sharded-cluster"], storage-engine: "mmapv1" }
display_name: "${version} Storage ${storage-engine} ${jdk} ${os} ${topology}"
Expand Down
15 changes: 12 additions & 3 deletions .evergreen/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ set -o errexit # Exit the script with error if any of the commands fail
############################################
# Main Program #
############################################
RELEASE=${RELEASE:false}

echo ${RING_FILE_GPG_BASE64} | base64 -d > ${PROJECT_DIRECTORY}/secring.gpg

trap "rm ${PROJECT_DIRECTORY}/secring.gpg; exit" EXIT HUP


git status

export ORG_GRADLE_PROJECT_nexusUsername=${NEXUS_USERNAME}
export ORG_GRADLE_PROJECT_nexusPassword=${NEXUS_PASSWORD}
Expand All @@ -23,6 +24,14 @@ export ORG_GRADLE_PROJECT_signing_secretKeyRingFile=${PROJECT_DIRECTORY}/secring
echo "Publishing snapshot with jdk11"
export JAVA_HOME="/opt/java/jdk11"

if [ "$RELEASE" == "true" ]; then
TASK="publishArchives"
else
TASK="publishSnapshots"
fi

SYSTEM_PROPERTIES="-Dorg.gradle.internal.publish.checksums.insecure=true -Dorg.gradle.internal.http.connectionTimeout=120000 -Dorg.gradle.internal.http.socketTimeout=120000"

./gradlew -version
./gradlew publishSnapshots
./gradlew :bson-scala:publishSnapshots :driver-scala:publishSnapshots -PdefaultScalaVersions=2.11.12,2.12.10
./gradlew ${SYSTEM_PROPERTIES} --stacktrace --info ${TASK}
./gradlew ${SYSTEM_PROPERTIES} --stacktrace --info :bson-scala:${TASK} :driver-scala:${TASK} -PdefaultScalaVersions=2.11.12,2.12.10
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,7 @@ docs/hugo*
**/mongocryptd.pid

# shell scripts
*.sh
*.sh

# security-sensitive files
*.gpg

0 comments on commit a53d0c7

Please sign in to comment.