summaryrefslogtreecommitdiff
path: root/eng/common/tools.ps1
diff options
context:
space:
mode:
authordotnet-maestro[bot] <42748379+dotnet-maestro[bot]@users.noreply.github.com>2020-02-14 01:45:08 +0000
committerGitHub <noreply@github.com>2020-02-14 01:45:08 +0000
commit6689dd74ef07963fb7bcc8072e80d7e6fd2cd1de (patch)
tree9eb45057d31c500b3fadb0daeea1cbb6a6f9efd3 /eng/common/tools.ps1
parentefcf98fc7885dc423bdf61b3423dddc63c36075f (diff)
downloadcoreclr-6689dd74ef07963fb7bcc8072e80d7e6fd2cd1de.tar.gz
coreclr-6689dd74ef07963fb7bcc8072e80d7e6fd2cd1de.tar.bz2
coreclr-6689dd74ef07963fb7bcc8072e80d7e6fd2cd1de.zip
Update dependencies from https://github.com/dotnet/arcade build 20200213.5 (#28018)
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.20113.5 - Microsoft.DotNet.Build.Tasks.Feed - 2.2.0-beta.20113.5 - Microsoft.DotNet.Build.Tasks.Packaging - 1.0.0-beta.20113.5 - Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.20113.5
Diffstat (limited to 'eng/common/tools.ps1')
-rw-r--r--eng/common/tools.ps139
1 files changed, 34 insertions, 5 deletions
diff --git a/eng/common/tools.ps1 b/eng/common/tools.ps1
index 91efea9405..92a053bd16 100644
--- a/eng/common/tools.ps1
+++ b/eng/common/tools.ps1
@@ -184,7 +184,14 @@ function InstallDotNetSdk([string] $dotnetRoot, [string] $version, [string] $arc
InstallDotNet $dotnetRoot $version $architecture
}
-function InstallDotNet([string] $dotnetRoot, [string] $version, [string] $architecture = "", [string] $runtime = "", [bool] $skipNonVersionedFiles = $false) {
+function InstallDotNet([string] $dotnetRoot,
+ [string] $version,
+ [string] $architecture = "",
+ [string] $runtime = "",
+ [bool] $skipNonVersionedFiles = $false,
+ [string] $runtimeSourceFeed = "",
+ [string] $runtimeSourceFeedKey = "") {
+
$installScript = GetDotNetInstallScript $dotnetRoot
$installParameters = @{
Version = $version
@@ -195,10 +202,32 @@ function InstallDotNet([string] $dotnetRoot, [string] $version, [string] $archit
if ($runtime) { $installParameters.Runtime = $runtime }
if ($skipNonVersionedFiles) { $installParameters.SkipNonVersionedFiles = $skipNonVersionedFiles }
- & $installScript @installParameters
- if ($lastExitCode -ne 0) {
- Write-PipelineTelemetryError -Category "InitializeToolset" -Message "Failed to install dotnet cli (exit code '$lastExitCode')."
- ExitWithExitCode $lastExitCode
+ try {
+ & $installScript @installParameters
+ }
+ catch {
+ Write-PipelineTelemetryError -Category "InitializeToolset" -Message "Failed to install dotnet runtime '$runtime' from public location."
+
+ # Only the runtime can be installed from a custom [private] location.
+ if ($runtime -and ($runtimeSourceFeed -or $runtimeSourceFeedKey)) {
+ if ($runtimeSourceFeed) { $installParameters.AzureFeed = $runtimeSourceFeed }
+
+ if ($runtimeSourceFeedKey) {
+ $decodedBytes = [System.Convert]::FromBase64String($runtimeSourceFeedKey)
+ $decodedString = [System.Text.Encoding]::UTF8.GetString($decodedBytes)
+ $installParameters.FeedCredential = $decodedString
+ }
+
+ try {
+ & $installScript @installParameters
+ }
+ catch {
+ Write-PipelineTelemetryError -Category "InitializeToolset" -Message "Failed to install dotnet runtime '$runtime' from custom location '$runtimeSourceFeed'."
+ ExitWithExitCode 1
+ }
+ } else {
+ ExitWithExitCode 1
+ }
}
}