From 820825e2ba24bb072ae93595a1fc12d21c8cfba0 Mon Sep 17 00:00:00 2001 From: Francisco-Gamino Date: Thu, 3 Feb 2022 17:16:14 -0800 Subject: [PATCH 1/4] Install .Net to a global location --- tools/helper.psm1 | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/tools/helper.psm1 b/tools/helper.psm1 index 1b07797a..e250458a 100644 --- a/tools/helper.psm1 +++ b/tools/helper.psm1 @@ -25,17 +25,8 @@ $DotnetSDKVersionRequirements = @{ $GrpcToolsVersion = '2.27.0' # grpc.tools $GoogleProtobufToolsVersion = '3.11.4' # google.protobuf.tools -function AddLocalDotnetDirPath { - $LocalDotnetDirPath = if ($IsWindowsEnv) { "$env:LocalAppData\Microsoft\dotnet" } else { "$env:HOME/.dotnet" } - if (($env:PATH -split [IO.Path]::PathSeparator) -notcontains $LocalDotnetDirPath) { - $env:PATH = $LocalDotnetDirPath + [IO.Path]::PathSeparator + $env:PATH - } -} - function Find-Dotnet { - AddLocalDotnetDirPath - $listSdksOutput = dotnet --list-sdks $installedDotnetSdks = $listSdksOutput | ForEach-Object { $_.Split(" ")[0] } Write-Log "Detected dotnet SDKs: $($installedDotnetSdks -join ', ')" @@ -65,7 +56,7 @@ function Install-Dotnet { return # Simply return if we find dotnet SDk with the correct version } catch { } - $obtainUrl = "https://raw.githubusercontent.com/dotnet/cli/master/scripts/obtain" + $obtainUrl = "https://raw.githubusercontent.com/dotnet/install-scripts/main/src" try { $installScript = if ($IsWindowsEnv) { "dotnet-install.ps1" } else { "dotnet-install.sh" } @@ -75,13 +66,12 @@ function Install-Dotnet { $version = "$majorMinorVersion.$($DotnetSDKVersionRequirements[$majorMinorVersion].DefaultPatch)" Write-Log "Installing dotnet SDK version $version" -Warning if ($IsWindowsEnv) { - & .\$installScript -Channel $Channel -Version $Version + & .\$installScript -Channel $Channel -Version $Version -InstallDir "$env:ProgramFiles/dotnet" } else { - bash ./$installScript -c $Channel -v $Version + bash ./$installScript -c $Channel -v $Version --install-dir /usr/share/dotnet } } - AddLocalDotnetDirPath } finally { Remove-Item $installScript -Force -ErrorAction SilentlyContinue From 25df31146f3bfd95169dff39735571bfe28621a1 Mon Sep 17 00:00:00 2001 From: Francisco-Gamino Date: Thu, 3 Feb 2022 17:26:14 -0800 Subject: [PATCH 2/4] Remove .Net installation tasks --- azure-pipelines.yml | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index f3ee4db4..df4ca6c9 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -58,17 +58,6 @@ steps: - pwsh: ./build.ps1 -NoBuild -Test displayName: 'Running UnitTest' -- pwsh: | - Invoke-WebRequest 'https://raw.githubusercontent.com/dotnet/cli/master/scripts/obtain/dotnet-install.ps1' -OutFile 'dotnet-install.ps1' - ./dotnet-install.ps1 -InstallDir "$env:ProgramFiles/dotnet" -Version "6.0.100" -Channel 'release' - displayName: 'Install the .Net version used by the Core Tools for Windows' - condition: eq( variables['Agent.OS'], 'Windows_NT' ) - -- bash: | - curl -sSL https://raw.githubusercontent.com/dotnet/cli/master/scripts/obtain/dotnet-install.sh | bash /dev/stdin -v '6.0.100' -c 'release' --install-dir /usr/share/dotnet - displayName: 'Install the .Net version used by the Core Tools for Linux' - condition: eq( variables['Agent.OS'], 'Linux' ) - - pwsh: ./test/E2E/Start-E2ETest.ps1 env: AzureWebJobsStorage: $(AzureWebJobsStorage) From 406ef320c3e2f7efa3eedeafd6bd49477d059418 Mon Sep 17 00:00:00 2001 From: Francisco-Gamino Date: Thu, 3 Feb 2022 18:56:37 -0800 Subject: [PATCH 3/4] Update install .Net 6 task --- azure-pipelines-e2e-integration-tests.yml | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/azure-pipelines-e2e-integration-tests.yml b/azure-pipelines-e2e-integration-tests.yml index 680b2e38..a6d7701d 100644 --- a/azure-pipelines-e2e-integration-tests.yml +++ b/azure-pipelines-e2e-integration-tests.yml @@ -18,15 +18,9 @@ pool: steps: - pwsh: | - Invoke-WebRequest 'https://raw.githubusercontent.com/dotnet/cli/master/scripts/obtain/dotnet-install.ps1' -OutFile 'dotnet-install.ps1' - ./dotnet-install.ps1 -InstallDir "$env:ProgramFiles/dotnet" -Version "6.0.100" -Channel 'release' - displayName: 'Install the .Net version used by the Core Tools for Windows' - condition: eq( variables['Agent.OS'], 'Windows_NT' ) - -- bash: | - curl -sSL https://raw.githubusercontent.com/dotnet/cli/master/scripts/obtain/dotnet-install.sh | bash /dev/stdin -v '6.0.100' -c 'release' --install-dir /usr/share/dotnet - displayName: 'Install the .Net version used by the Core Tools for Linux' - condition: eq( variables['Agent.OS'], 'Linux' ) + Import-Module "./tools/helper.psm1" -Force + Install-Dotnet + displayName: 'Install .NET 6.0' - pwsh: ./test/E2E/Start-E2ETest.ps1 -UseCoreToolsBuildFromIntegrationTests env: From fcca56ce7ace79245d1bca89994b31b8caba573a Mon Sep 17 00:00:00 2001 From: Francisco-Gamino Date: Thu, 3 Feb 2022 18:59:49 -0800 Subject: [PATCH 4/4] Update Windows image to use windows-latest --- azure-pipelines-e2e-integration-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines-e2e-integration-tests.yml b/azure-pipelines-e2e-integration-tests.yml index a6d7701d..4df22ec5 100644 --- a/azure-pipelines-e2e-integration-tests.yml +++ b/azure-pipelines-e2e-integration-tests.yml @@ -11,7 +11,7 @@ strategy: linux: imageName: 'ubuntu-latest' windows: - imageName: 'vs2017-win2016' + imageName: 'windows-latest' pool: vmImage: $(imageName)