@@ -30,49 +30,24 @@ RED="\033[0;31m"
3030YELLOW=" \033[0;33m"
3131MAGENTA=" \033[0;95m"
3232
33- curl -o dotnet-install.sh -sSL https://dot.net/v1/dotnet-install.sh
34- if [ $? -ne 0 ]; then
35- download_retries=3
36- while [ $download_retries -gt 0 ]; do
37- curl -o dotnet-install.sh -sSL https://dot.net/v1/dotnet-install.sh
38- if [ $? -ne 0 ]; then
39- let download_retries=download_retries-1
40- echo -e " ${YELLOW} Failed to download dotnet-install.sh. Retries left: $download_retries .${RESET} "
41- else
42- download_retries=0
43- fi
44- done
45- fi
46-
47- # Call "sync" between "chmod" and execution to prevent "text file busy" error in Docker (aufs)
48- chmod +x " dotnet-install.sh" ; sync
49-
50- ./dotnet-install.sh --version $dotnet_sdk_version --install-dir " $DOTNET_ROOT "
51- if [ $? -ne 0 ]; then
52- sdk_retries=3
53- while [ $sdk_retries -gt 0 ]; do
54- ./dotnet-install.sh --version $dotnet_sdk_version --install-dir " $DOTNET_ROOT "
55- if [ $? -ne 0 ]; then
56- let sdk_retries=sdk_retries-1
57- echo -e " ${YELLOW} Failed to install .NET Core SDK $version . Retries left: $sdk_retries .${RESET} "
58- else
59- sdk_retries=0
60- fi
61- done
62- fi
63-
64- ./dotnet-install.sh --runtime dotnet --version $dotnet_runtime_version --install-dir " $DOTNET_ROOT "
65- if [ $? -ne 0 ]; then
66- runtime_retries=3
67- while [ $runtime_retries -gt 0 ]; do
68- ./dotnet-install.sh --runtime dotnet --version $dotnet_runtime_version --install-dir " $DOTNET_ROOT "
69- if [ $? -ne 0 ]; then
70- let runtime_retries=runtime_retries-1
71- echo -e " ${YELLOW} Failed to install .NET Core runtime $version . Retries left: $runtime_retries .${RESET} "
72- else
73- runtime_retries=0
74- fi
75- done
33+ . eng/common/tools.sh
34+ InstallDotNet $DOTNET_ROOT $dotnet_sdk_version " " " " true || {
35+ exit_code=$?
36+ Write-PipelineTelemetryError -Category ' InitializeToolset' -Message " dotnet-install.sh failed (exit code '$exit_code ')." >&2
37+ ExitWithExitCode $exit_code
38+ }
39+ if [[ -z " ${11:- } " ]]; then
40+ InstallDotNet $DOTNET_ROOT $dotnet_runtime_version " " dotnet true || {
41+ exit_code=$?
42+ Write-PipelineTelemetryError -Category ' InitializeToolset' -Message " dotnet-install.sh failed (exit code '$exit_code ')." >&2
43+ ExitWithExitCode $exit_code
44+ }
45+ else
46+ InstallDotNet $DOTNET_ROOT $dotnet_runtime_version " " dotnet true https://dotnetclimsrc.blob.core.windows.net/dotnet ${11} || {
47+ exit_code=$?
48+ Write-PipelineTelemetryError -Category ' InitializeToolset' -Message " dotnet-install.sh failed (exit code '$exit_code ')." >&2
49+ ExitWithExitCode $exit_code
50+ }
7651fi
7752
7853if [ -e /proc/self/coredump_filter ]; then
@@ -82,7 +57,7 @@ if [ -e /proc/self/coredump_filter ]; then
8257 echo -n 0x3F > /proc/self/coredump_filter
8358fi
8459
85- # dontet -install.sh seems to affect the Linux filesystem and causes test flakiness unless we sync the filesystem before running tests
60+ # dotnet -install.sh seems to affect the Linux filesystem and causes test flakiness unless we sync the filesystem before running tests
8661sync
8762
8863exit_code=0
0 commit comments