Skip to content

Commit

Permalink
fix(ci): build git 2.x if not present on host (#874)
Browse files Browse the repository at this point in the history
There is no git 2.x on the s390x hosts. Lerna needs git 2.x.
Consequentially, we build it before running our tasks.
  • Loading branch information
addaleax authored May 18, 2021
1 parent c923cff commit 51ffe4e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
8 changes: 8 additions & 0 deletions .evergreen/.install_node
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ else

nvm install --no-progress $NODE_JS_VERSION
nvm alias default $NODE_JS_VERSION

if env PATH="/opt/chefdk/gitbin:$PATH" git --version | grep -q 'git version 1.'; then
(cd "$BASEDIR" &&
curl -sSfL https://github.com/git/git/archive/refs/tags/v2.31.1.tar.gz | tar -xvz &&
mv git-2.31.1 git-2 &&
cd git-2 &&
make -j8 NO_EXPAT=1)
fi
fi

. "$BASEDIR/.setup_env"
Expand Down
6 changes: 5 additions & 1 deletion .evergreen/.setup_env
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
set -e
set -x
export BASEDIR="$PWD/.evergreen"
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"
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"
export IS_MONGOSH_EVERGREEN_CI=1

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

echo "Using g++ version:"
g++ --version

if [ -x "$BASEDIR/git-2/git" ]; then
export GIT_EXEC_PATH="$BASEDIR/git-2"
fi
fi

export EVERGREEN_EXPANSIONS_PATH="$BASEDIR/../../tmp/expansions.yaml"
Expand Down

0 comments on commit 51ffe4e

Please sign in to comment.