diff options
author | Ryan Egesdahl <ryan.egesdahl@mongodb.com> | 2022-05-31 19:08:04 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-05-31 19:44:27 +0000 |
commit | 79c61c07d61102ca7ca387880a23543faf156ca3 (patch) | |
tree | 1a817c9dac84b6fbecb41e96bce92178b334f27f /evergreen | |
parent | b9da1f22bd8eb4bcca71250907a97b4ca5a13911 (diff) | |
download | mongo-79c61c07d61102ca7ca387880a23543faf156ca3.tar.gz |
SERVER-63191 Generate build expansions early
Diffstat (limited to 'evergreen')
-rwxr-xr-x | evergreen/functions/binary_version_check.sh | 2 | ||||
-rw-r--r-- | evergreen/functions/compile_expansions_generate.sh | 12 | ||||
-rwxr-xr-x | evergreen/functions/version_expansions_generate.sh | 17 |
3 files changed, 20 insertions, 11 deletions
diff --git a/evergreen/functions/binary_version_check.sh b/evergreen/functions/binary_version_check.sh index ac01374a07e..a83aa0dc203 100755 --- a/evergreen/functions/binary_version_check.sh +++ b/evergreen/functions/binary_version_check.sh @@ -6,7 +6,7 @@ cd src set -o errexit mongo_binary=dist-test/bin/mongo${exe} activate_venv -bin_ver=$($python -c "import yaml; print(yaml.safe_load(open('compile_expansions.yml'))['version']);" | tr -d '[ \r\n]') +bin_ver=$($python -c "import yaml; print(yaml.safe_load(open('version_expansions.yml'))['version']);" | tr -d '[ \r\n]') # Due to SERVER-23810, we cannot use $mongo_binary --quiet --nodb --eval "version();" mongo_ver=$($mongo_binary --version | perl -pe '/version v([^\"]*)/; $_ = $1;' | tr -d '[ \r\n]') # The versions must match diff --git a/evergreen/functions/compile_expansions_generate.sh b/evergreen/functions/compile_expansions_generate.sh index dc9642f5cd4..fe06d0fdf7d 100644 --- a/evergreen/functions/compile_expansions_generate.sh +++ b/evergreen/functions/compile_expansions_generate.sh @@ -5,14 +5,6 @@ cd src set -o errexit set -o verbose -# We get the raw version string (r1.2.3-45-gabcdef) from git -MONGO_VERSION=$(git describe --abbrev=7) -# 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 -echo "MONGO_VERSION = ${MONGO_VERSION}" activate_venv # shared scons cache testing # if 'scons_cache_scope' enabled and project level 'disable_shared_scons_cache' is not true @@ -43,12 +35,12 @@ if [ ! -z ${scons_cache_scope} ]; then set -o errexit fi echo "Shared Cache with setting: ${scons_cache_scope}" - MONGO_VERSION=$MONGO_VERSION SCONS_CACHE_MODE=${scons_cache_mode} SCONS_CACHE_SCOPE=$scons_cache_scope IS_PATCH=${is_patch} IS_COMMIT_QUEUE=${is_commit_queue} $python buildscripts/generate_compile_expansions_shared_cache.py --out compile_expansions.yml + SCONS_CACHE_MODE=${scons_cache_mode} SCONS_CACHE_SCOPE=$scons_cache_scope IS_PATCH=${is_patch} IS_COMMIT_QUEUE=${is_commit_queue} $python buildscripts/generate_compile_expansions_shared_cache.py --out compile_expansions.yml # Legacy Expansion generation else echo "Using legacy expansion generation" # Proceed with regular expansions generated # This script converts the generated version string into a sanitized version string for # use by scons and uploading artifacts as well as information about for the scons cache. - MONGO_VERSION=$MONGO_VERSION SCONS_CACHE_MODE=${scons_cache_mode} USE_SCONS_CACHE=${use_scons_cache} $python buildscripts/generate_compile_expansions.py --out compile_expansions.yml + SCONS_CACHE_MODE=${scons_cache_mode} USE_SCONS_CACHE=${use_scons_cache} IS_PATCH=${is_patch} IS_COMMIT_QUEUE=${is_commit_queue} $python buildscripts/generate_compile_expansions.py --out compile_expansions.yml fi diff --git a/evergreen/functions/version_expansions_generate.sh b/evergreen/functions/version_expansions_generate.sh new file mode 100755 index 00000000000..6dae45134d9 --- /dev/null +++ b/evergreen/functions/version_expansions_generate.sh @@ -0,0 +1,17 @@ +DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" > /dev/null 2>&1 && pwd)" +. "$DIR/../prelude.sh" + +cd src + +set -o errexit +set -o verbose +# We get the raw version string (r1.2.3-45-gabcdef) from git +MONGO_VERSION=$(git describe --abbrev=7) +# 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 +echo "MONGO_VERSION = ${MONGO_VERSION}" + +MONGO_VERSION=${MONGO_VERSION} IS_PATCH=${is_patch} IS_COMMIT_QUEUE=${is_commit_queue} buildscripts/generate_version_expansions.py --out version_expansions.yml |