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-21 15:25:36 -0400
commitd3c81ef49f77a0bae5e0ebe9dd002df98348c8f2 (patch)
tree2ac55f1b97e9732106094a6435eccd3aec18b73b
parentdfe69f949be0e1aa83efcaaea07cc0c4639677bf (diff)
downloadmongo-d3c81ef49f77a0bae5e0ebe9dd002df98348c8f2.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.yml29
1 files changed, 25 insertions, 4 deletions
diff --git a/etc/evergreen.yml b/etc/evergreen.yml
index e0836076d98..5f689d0a46e 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,9 @@ 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 +575,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