Skip to content

Commit 42d72b7

Browse files
authored
ci(NODE-5110): update curl flags (#3598)
1 parent 6fd568b commit 42d72b7

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

.evergreen/install-dependencies.sh

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,17 @@ NODE_LTS_NAME=${NODE_LTS_NAME:-fermium}
55
NODE_ARTIFACTS_PATH="${PROJECT_DIRECTORY:-$(pwd)}/node-artifacts"
66
if [[ "$OS" = "Windows_NT" ]]; then NODE_ARTIFACTS_PATH=$(cygpath --unix "$NODE_ARTIFACTS_PATH"); fi
77

8+
CURL_FLAGS=(
9+
--fail # Exit code 1 if request fails
10+
--compressed # Request a compressed response should keep fetching fast
11+
--location # Follow a redirect
12+
--retry 8 # Retry HTTP 408, 429, 500, 502, 503 or 504, 8 times
13+
--silent # Do not print a progress bar
14+
--show-error # Despite the silent flag still print out errors
15+
--max-time 900 # 900 seconds is 15 minutes, evergreen times out at 20
16+
--continue-at - # If a download is interrupted it can figure out where to resume
17+
)
18+
819
mkdir -p "$NODE_ARTIFACTS_PATH/npm_global"
920

1021
# Comparisons are all case insensitive
@@ -13,7 +24,7 @@ shopt -s nocasematch
1324
# index.tab is a sorted tab separated values file with the following headers
1425
# 0 1 2 3 4 5 6 7 8 9 10
1526
# version date files npm v8 uv zlib openssl modules lts security
16-
curl --retry 8 -sS "https://nodejs.org/dist/index.tab" --max-time 300 --output node_index.tab
27+
curl "${CURL_FLAGS[@]}" "https://nodejs.org/dist/index.tab" --output node_index.tab
1728

1829
while IFS=$'\t' read -r -a row; do
1930
node_index_version="${row[0]}"
@@ -63,7 +74,7 @@ echo "Node.js ${node_index_version} for ${operating_system}-${architecture} rele
6374

6475
set -o xtrace
6576

66-
curl --fail --retry 8 -sS "${node_download_url}" --max-time 300 --output "$node_archive_path"
77+
curl "${CURL_FLAGS[@]}" "${node_download_url}" --output "$node_archive_path"
6778

6879
if [[ "$file_extension" = "zip" ]]; then
6980
unzip -q "$node_archive_path" -d "${NODE_ARTIFACTS_PATH}"

0 commit comments

Comments
 (0)