Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update PowerShell language worker pipelines #750

Merged
merged 4 commits into from
Feb 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 4 additions & 10 deletions azure-pipelines-e2e-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,16 @@ strategy:
linux:
imageName: 'ubuntu-latest'
windows:
imageName: 'vs2017-win2016'
imageName: 'windows-latest'

pool:
vmImage: $(imageName)

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:
Expand Down
11 changes: 0 additions & 11 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
16 changes: 3 additions & 13 deletions tools/helper.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -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 ', ')"
Expand Down Expand Up @@ -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" }
Expand All @@ -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
Expand Down