Skip to content

Commit a305fbf

Browse files
[main] Update common Docker engineering infrastructure with latest (#6351)
1 parent 6f001c5 commit a305fbf

2 files changed

Lines changed: 14 additions & 4 deletions

File tree

eng/common/Install-DotNetSdk.ps1

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,16 @@ Install the .NET Core SDK at the specified path.
1111
.PARAMETER InstallPath
1212
The path where the .NET Core SDK is to be installed.
1313
14+
.PARAMETER Channel
15+
The version of the .NET Core SDK to be installed.
16+
1417
#>
1518
[cmdletbinding()]
1619
param(
1720
[string]
18-
$InstallPath
21+
$InstallPath,
22+
[string]
23+
$Channel = "9.0"
1924
)
2025

2126
Set-StrictMode -Version Latest
@@ -40,7 +45,7 @@ if (!(Test-Path $DotnetInstallScriptPath)) {
4045
& "$PSScriptRoot/Invoke-WithRetry.ps1" "Invoke-WebRequest 'https://builds.dotnet.microsoft.com/dotnet/scripts/v1/$DotnetInstallScript' -OutFile $DotnetInstallScriptPath"
4146
}
4247

43-
$DotnetChannel = "9.0"
48+
$DotnetChannel = $Channel
4449

4550
$InstallFailed = $false
4651
if ($IsRunningOnUnix) {

eng/common/templates/jobs/cg-build-projects.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ parameters:
77
type: boolean
88
default: false
99
displayName: CG Dry Run
10+
# See https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-install-script#options for possible Channel values
11+
- name: dotnetVersionChannel
12+
type: string
13+
default: '9.0'
14+
displayName: .NET Version
1015

1116
jobs:
1217
- job: BuildProjects
@@ -17,7 +22,7 @@ jobs:
1722
os: linux
1823
steps:
1924
- powershell: >
20-
./eng/common/Install-DotNetSdk.ps1 /usr/share/.dotnet
25+
./eng/common/Install-DotNetSdk.ps1 -Channel ${{ parameters.dotnetVersionChannel }} -InstallPath "/usr/share/.dotnet"
2126
displayName: Run Dotnet Install Script
2227
- script: >
2328
find . -name '*.csproj' | grep $(cgBuildGrepArgs) | xargs -n 1 /usr/share/.dotnet/dotnet build
@@ -29,7 +34,7 @@ jobs:
2934
- powershell: |
3035
Write-Host "##vso[build.updatebuildnumber]$env:BUILD_BUILDNUMBER (Dry run)"
3136
Write-Host "##vso[build.addbuildtag]dry-run"
32-
37+
3338
if ("$(officialBranches)".Split(',').Contains("$(Build.SourceBranch)"))
3439
{
3540
Write-Host "##vso[task.logissue type=error]Cannot run a CG dry-run build from an official branch ($(officialBranches))."

0 commit comments

Comments
 (0)