summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Reams <jbreams@mongodb.com>2016-04-22 13:34:34 -0400
committerRamon Fernandez <ramon@mongodb.com>2016-06-28 14:21:04 -0400
commit30162fa8bbb9d7e7f7a789361aed7e046995f7b3 (patch)
tree4a3b3f1f5e9e06c591f9c597956f9c0051300f8d
parent59ec7595abf1971122fa21fa7f2c211c3292dbeb (diff)
downloadmongo-30162fa8bbb9d7e7f7a789361aed7e046995f7b3.tar.gz
SERVER-21977 Add patch id to version string in patch builds
(cherry picked from commit 82c824265264d21c14de848311fed36f987852c1) Conflicts: etc/evergreen.yml
-rw-r--r--etc/evergreen.yml31
1 files changed, 25 insertions, 6 deletions
diff --git a/etc/evergreen.yml b/etc/evergreen.yml
index e0836076d98..eb467b4de0d 100644
--- a/etc/evergreen.yml
+++ b/etc/evergreen.yml
@@ -523,6 +523,30 @@ tasks:
- func: "build new tools" # noop if ${newtools} is not "true"
- func: "build rocksdb" # noop if ${build_rocksdb} is not "true"
- command: shell.exec
+ params:
+ working_dir: src
+ script: |
+ set -o errexit
+ set -o verbose
+
+ # We get the raw version string (r1.2.3-45-gabcdef) from git
+ MONGO_VERSION=$(git describe)
+ # If this is a patch build, we add the patch version id to the version string so we know
+ # this build was a patch, and which evergreen task it came from
+ if [ "${is_patch|}" = "true" ]; then
+ MONGO_VERSION="$MONGO_VERSION-patch-${version_id}"
+ fi
+
+ # This script converts the generated version string into a sanitized version string for
+ # use by scons and uploading artifacts.
+ echo $MONGO_VERSION | ${python|python} buildscripts/generate_compile_expansions.py | tee compile_expansions.yml
+
+ # Then we load the generated version data into the agent so we can use it in task definitions
+ - command: expansions.update
+ params:
+ file: src/compile_expansions.yml
+
+ - command: shell.exec
type: test
params:
working_dir: src
@@ -531,9 +555,7 @@ tasks:
set -o verbose
rm -rf ${install_directory|/data/mongo-install-directory}
- ${scons|scons} ${compile_flags|} --use-new-tools all dist dist-debugsymbols distsrc-${ext|tgz} ${msi_target|}
-
- git describe | ${python|python} buildscripts/generate_compile_expansions.py | tee compile_expansions.yml
+ ${scons|scons} ${compile_flags|} --use-new-tools all dist dist-debugsymbols distsrc-${ext|tgz} ${msi_target|} MONGO_VERSION=${version}
mv mongodb-src-*.${ext|tgz} distsrc.${ext|tgz}
mv mongodb-*-debugsymbols.${ext|tgz} mongo-debugsymbols.tgz || true
@@ -551,9 +573,6 @@ tasks:
# On windows we need to make sure the paths in unittests.txt are compatible with cygwin tar
sed 's|\\|/|g' build/unittests.txt > build/unittests-tarlist.txt
${tar|tar} -czvf mongodb-unittests.tgz -T build/unittests-tarlist.txt build/unittests.txt
- - command: expansions.update
- params:
- file: src/compile_expansions.yml
- command: shell.exec
params:
working_dir: src