From 4cb46f10f4e966ecb304fc6f8e520ab6c8d92935 Mon Sep 17 00:00:00 2001 From: minnakt Date: Fri, 1 Mar 2024 14:54:44 -0500 Subject: [PATCH] DEVPROD-787: Retry Node installation on CI --- .evergreen.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.evergreen.yml b/.evergreen.yml index 5ecb67be..d2b331fe 100644 --- a/.evergreen.yml +++ b/.evergreen.yml @@ -227,6 +227,7 @@ functions: shell: bash script: | ${PREPARE_SHELL} + # Fetch NVM and install it into this task's .nvm directory # Once downloaded, source nvm and install yarn git clone https://github.com/nvm-sh/nvm.git "$NVM_DIR" @@ -234,7 +235,14 @@ functions: git checkout `git describe --abbrev=0 --tags --match "v[0-9]*" $(git rev-list --tags --max-count=1)` [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" cd - - nvm install --no-progress --default ${node_version} + + # Retry the download for Node in case it flakes. + for i in {1..5}; do + nvm install --no-progress --default ${node_version} + [[ $? -eq 0 ]] && break + echo "Attempt $i of 5 to install Node failed" + sleep 10 + done npm install -g yarn sym-link: