Update dependencies from https://github.com/dotnet/arcade build 20201110.3 (#9039)
[release/5.0.2xx] Update dependencies from dotnet/arcade
This commit is contained in:
parent
3599b2ecaf
commit
4e810da96b
11 changed files with 217 additions and 2144 deletions
|
@ -62,10 +62,6 @@ $ErrorActionPreference = 'Stop'
|
|||
# Base-64 encoded SAS token that has permission to storage container described by $runtimeSourceFeed
|
||||
[string]$runtimeSourceFeedKey = if (Test-Path variable:runtimeSourceFeedKey) { $runtimeSourceFeedKey } else { $null }
|
||||
|
||||
# If false, use copy of dotnet-install from /eng/common/dotnet-install-scripts (for custom behaviors).
|
||||
# otherwise will fetch from public location.
|
||||
[bool]$useDefaultDotnetInstall = if (Test-Path variable:useDefaultDotnetInstall) { $useDefaultDotnetInstall } else { $false }
|
||||
|
||||
function Create-Directory ([string[]] $path) {
|
||||
New-Item -Path $path -Force -ItemType 'Directory' | Out-Null
|
||||
}
|
||||
|
@ -197,46 +193,37 @@ function InitializeDotNetCli([bool]$install, [bool]$createSdkLocationFile) {
|
|||
function GetDotNetInstallScript([string] $dotnetRoot) {
|
||||
$installScript = Join-Path $dotnetRoot 'dotnet-install.ps1'
|
||||
if (!(Test-Path $installScript)) {
|
||||
create-directory $dotnetroot
|
||||
Create-Directory $dotnetRoot
|
||||
$ProgressPreference = 'SilentlyContinue' # Don't display the console progress UI - it's a huge perf hit
|
||||
|
||||
if ($useDefaultDotnetInstall)
|
||||
{
|
||||
$progresspreference = 'silentlycontinue' # don't display the console progress ui - it's a huge perf hit
|
||||
$maxRetries = 5
|
||||
$retries = 1
|
||||
|
||||
$maxretries = 5
|
||||
$retries = 1
|
||||
$uri = "https://dot.net/$dotnetInstallScriptVersion/dotnet-install.ps1"
|
||||
|
||||
$uri = "https://dot.net/$dotnetinstallscriptversion/dotnet-install.ps1"
|
||||
|
||||
while($true) {
|
||||
try {
|
||||
write-host "get $uri"
|
||||
invoke-webrequest $uri -outfile $installscript
|
||||
break
|
||||
}
|
||||
catch {
|
||||
write-host "failed to download '$uri'"
|
||||
write-error $_.exception.message -erroraction continue
|
||||
}
|
||||
|
||||
if (++$retries -le $maxretries) {
|
||||
$delayinseconds = [math]::pow(2, $retries) - 1 # exponential backoff
|
||||
write-host "retrying. waiting for $delayinseconds seconds before next attempt ($retries of $maxretries)."
|
||||
start-sleep -seconds $delayinseconds
|
||||
}
|
||||
else {
|
||||
throw "unable to download file in $maxretries attempts."
|
||||
}
|
||||
while($true) {
|
||||
try {
|
||||
Write-Host "GET $uri"
|
||||
Invoke-WebRequest $uri -OutFile $installScript
|
||||
break
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
# Use a special version of the script from eng/common that understands the existence of a "productVersion.txt" in a dotnet path.
|
||||
# See https://github.com/dotnet/arcade/issues/6047 for details
|
||||
$engCommonCopy = Resolve-Path (Join-Path $PSScriptRoot 'dotnet-install-scripts\dotnet-install.ps1')
|
||||
Copy-Item $engCommonCopy -Destination $installScript -Force
|
||||
catch {
|
||||
Write-Host "Failed to download '$uri'"
|
||||
Write-Error $_.Exception.Message -ErrorAction Continue
|
||||
}
|
||||
|
||||
if (++$retries -le $maxRetries) {
|
||||
$delayInSeconds = [math]::Pow(2, $retries) - 1 # Exponential backoff
|
||||
Write-Host "Retrying. Waiting for $delayInSeconds seconds before next attempt ($retries of $maxRetries)."
|
||||
Start-Sleep -Seconds $delayInSeconds
|
||||
}
|
||||
else {
|
||||
throw "Unable to download file in $maxRetries attempts."
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return $installScript
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue