Skip to content

Commit 51ffe4e

Browse files
authored
fix(ci): build git 2.x if not present on host (#874)
There is no git 2.x on the s390x hosts. Lerna needs git 2.x. Consequentially, we build it before running our tasks.
1 parent c923cff commit 51ffe4e

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

.evergreen/.install_node

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@ else
1818

1919
nvm install --no-progress $NODE_JS_VERSION
2020
nvm alias default $NODE_JS_VERSION
21+
22+
if env PATH="/opt/chefdk/gitbin:$PATH" git --version | grep -q 'git version 1.'; then
23+
(cd "$BASEDIR" &&
24+
curl -sSfL https://github.com/git/git/archive/refs/tags/v2.31.1.tar.gz | tar -xvz &&
25+
mv git-2.31.1 git-2 &&
26+
cd git-2 &&
27+
make -j8 NO_EXPAT=1)
28+
fi
2129
fi
2230

2331
. "$BASEDIR/.setup_env"

.evergreen/.setup_env

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
set -e
22
set -x
33
export BASEDIR="$PWD/.evergreen"
4-
export PATH="$BASEDIR/node-v$NODE_JS_VERSION-win-x64:/opt/python/3.6/bin:/opt/chefdk/gitbin:/cygdrive/c/Program Files/Git/bin:/cygdrive/c/Program Files/Git/mingw32/libexec/git-core:/cygdrive/c/Python39/Scripts:/cygdrive/c/Python39:/cygdrive/c/cmake/bin:/opt/mongodbtoolchain/v3/bin:$PATH"
4+
export PATH="$BASEDIR/git-2:$BASEDIR/node-v$NODE_JS_VERSION-win-x64:/opt/python/3.6/bin:/opt/chefdk/gitbin:/cygdrive/c/Program Files/Git/bin:/cygdrive/c/Program Files/Git/mingw32/libexec/git-core:/cygdrive/c/Python39/Scripts:/cygdrive/c/Python39:/cygdrive/c/cmake/bin:/opt/mongodbtoolchain/v3/bin:$PATH"
55
export IS_MONGOSH_EVERGREEN_CI=1
66

77
if [ "$OS" != "Windows_NT" ]; then
@@ -22,6 +22,10 @@ if [ "$OS" != "Windows_NT" ]; then
2222

2323
echo "Using g++ version:"
2424
g++ --version
25+
26+
if [ -x "$BASEDIR/git-2/git" ]; then
27+
export GIT_EXEC_PATH="$BASEDIR/git-2"
28+
fi
2529
fi
2630

2731
export EVERGREEN_EXPANSIONS_PATH="$BASEDIR/../../tmp/expansions.yaml"

0 commit comments

Comments
 (0)