SERVER-127470: Use git hash prefix instead of suffix in version strings (#54377)
GitOrigin-RevId: 8816fa3cf7191208a5c1923922d8e7f174b84a19
This commit is contained in:
parent
c0bc268ebc
commit
c5ff683b5b
@ -25,10 +25,10 @@ if [ "${is_patch}" = "true" ]; then
|
||||
MONGO_VERSION="$MONGO_VERSION-patch-${version_id}"
|
||||
fi
|
||||
|
||||
# For commit builds, append the last 8 characters of the git revision to the version string.
|
||||
# For commit builds, append the first 8 characters of the git revision to the version string.
|
||||
if [[ "${requester}" == "commit" ]]; then
|
||||
GIT_REV=$(git rev-parse HEAD)
|
||||
MONGO_VERSION="${MONGO_VERSION}-${GIT_REV: -8}"
|
||||
MONGO_VERSION="${MONGO_VERSION}-${GIT_REV:0:8}"
|
||||
fi
|
||||
|
||||
# Forcefully override the version for purposes of testing against a different version than the
|
||||
|
||||
@ -41,7 +41,7 @@ if [[ "${requester}" == "commit" ]]; then
|
||||
echo "Unable to extract MONGO_VERSION from .bazelrc.target_mongo_version" >&2
|
||||
exit 1
|
||||
fi
|
||||
echo "common --define MONGO_VERSION=${mongo_version}-${GIT_REV: -8}" >>.bazelrc.git
|
||||
echo "common --define MONGO_VERSION=${mongo_version}-${GIT_REV:0:8}" >>.bazelrc.git
|
||||
fi
|
||||
|
||||
if [[ "${evergreen_remote_exec}" != "on" ]]; then
|
||||
|
||||
@ -11,10 +11,10 @@ if [[ -z "${target_mongo_version}" ]]; then
|
||||
fi
|
||||
version="r${target_mongo_version}"
|
||||
|
||||
# For commit builds, append the last 8 characters of the git revision to the version string.
|
||||
# For commit builds, append the first 8 characters of the git revision to the version string.
|
||||
if [[ "${requester:-}" == "commit" ]]; then
|
||||
GIT_REV=$(git rev-parse HEAD)
|
||||
version="${version}-${GIT_REV: -8}"
|
||||
version="${version}-${GIT_REV:0:8}"
|
||||
fi
|
||||
|
||||
if [ ${IS_RELEASE} = 'true' ]; then
|
||||
|
||||
Loading…
Reference in New Issue
Block a user