Skip to content

Commit 1865cd2

Browse files
TravisEz13SIRMARGIN
authored andcommitted
Update container images to use mcr.microsoft.com for Linux and Azure … (PowerShell#25981)
1 parent 8ed8eae commit 1865cd2

9 files changed

Lines changed: 21 additions & 16 deletions

.pipelines/PowerShell-Coordinated_Packages-Official.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ variables:
6969
- name: __DOTNET_RUNTIME_FEED
7070
value: ${{ parameters.InternalSDKBlobURL }}
7171
- name: LinuxContainerImage
72-
value: onebranch.azurecr.io/linux/ubuntu-2004:latest
72+
value: mcr.microsoft.com/onebranch/azurelinux/build:3.0
7373
- name: WindowsContainerImage
7474
value: onebranch.azurecr.io/windows/ltsc2019/vse2022:latest
7575
- name: CDP_DEFINITION_BUILD_COUNT
@@ -99,7 +99,8 @@ variables:
9999
# Disable BinSkim at job level to override NonOfficial template defaults
100100
- name: ob_sdl_binskim_enabled
101101
value: false
102-
102+
- name: ps_official_build
103+
value: ${{ parameters.OfficialBuild }}
103104

104105
extends:
105106
template: ${{ variables.templateFile }}
@@ -143,7 +144,7 @@ extends:
143144
- job: SetVars
144145
displayName: Set Variables
145146
pool:
146-
type: windows
147+
type: linux
147148

148149
variables:
149150
- name: ob_outputDirectory

.pipelines/PowerShell-Packages-Official.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ variables:
5656
- name: WindowsContainerImage
5757
value: 'onebranch.azurecr.io/windows/ltsc2022/vse2022:latest' # Docker image which is used to build the project
5858
- name: LinuxContainerImage
59-
value: mcr.microsoft.com/onebranch/cbl-mariner/build:2.0
59+
value: mcr.microsoft.com/onebranch/azurelinux/build:3.0
6060
- group: mscodehub-feed-read-general
6161
- group: mscodehub-feed-read-akv
6262
- name: branchCounterKey
@@ -66,7 +66,6 @@ variables:
6666
- group: MSIXSigningProfile
6767
- name: templateFile
6868
value: ${{ iif ( parameters.OfficialBuild, 'v2/OneBranch.Official.CrossPlat.yml@onebranchTemplates', 'v2/OneBranch.NonOfficial.CrossPlat.yml@onebranchTemplates' ) }}
69-
7069

7170
resources:
7271
pipelines:

.pipelines/PowerShell-Release-Official-Azure.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,10 @@ variables:
4747
- name: WindowsContainerImage
4848
value: 'onebranch.azurecr.io/windows/ltsc2022/vse2022:latest'
4949
- name: LinuxContainerImage
50-
value: mcr.microsoft.com/onebranch/cbl-mariner/build:2.0
50+
value: mcr.microsoft.com/onebranch/azurelinux/build:3.0
5151
- group: PoolNames
5252
- name: templateFile
5353
value: ${{ iif ( parameters.OfficialBuild, 'v2/OneBranch.Official.CrossPlat.yml@onebranchTemplates', 'v2/OneBranch.NonOfficial.CrossPlat.yml@onebranchTemplates' ) }}
54-
5554

5655
resources:
5756
repositories:

.pipelines/PowerShell-Release-Official.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ variables:
5757
- name: WindowsContainerImage
5858
value: 'onebranch.azurecr.io/windows/ltsc2022/vse2022:latest'
5959
- name: LinuxContainerImage
60-
value: mcr.microsoft.com/onebranch/cbl-mariner/build:2.0
60+
value: mcr.microsoft.com/onebranch/azurelinux/build:3.0
6161
- name: ReleaseTagVar
6262
value: ${{ parameters.ReleaseTagVar }}
6363
- group: PoolNames
@@ -284,7 +284,7 @@ extends:
284284
285285
- stage: PublishGitHubReleaseAndNuget
286286
displayName: Publish GitHub and Nuget Release
287-
dependsOn:
287+
dependsOn:
288288
- setReleaseTagAndChangelog
289289
- UpdateChangeLog
290290
variables:
@@ -404,7 +404,7 @@ extends:
404404

405405
- stage: ChangesToMaster
406406
displayName: Ensure changes are in GH master
407-
dependsOn:
407+
dependsOn:
408408
- PublishPMC
409409
jobs:
410410
- template: /.pipelines/templates/approvalJob.yml@self

.pipelines/apiscan-gen-notice.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ variables:
2626
- group: 'ComponentGovernance'
2727
- group: 'PoolNames'
2828
- name: LinuxContainerImage
29-
value: onebranch.azurecr.io/linux/ubuntu-2004:latest
29+
value: mcr.microsoft.com/onebranch/azurelinux/build:3.0
3030
- name: WindowsContainerImage
3131
value: onebranch.azurecr.io/windows/ltsc2022/vse2022:latest
3232
- ${{ if eq(parameters['FORCE_CODEQL'],'true') }}:

.pipelines/templates/linux.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,5 +201,6 @@ jobs:
201201
- template: /.pipelines/templates/obp-file-signing.yml@self
202202
parameters:
203203
binPath: $(DropRootPath)
204+
OfficialBuild: $(ps_official_build)
204205

205206
- template: /.pipelines/templates/step/finalize.yml@self

.pipelines/templates/mac.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,5 +148,6 @@ jobs:
148148
- template: /.pipelines/templates/obp-file-signing.yml@self
149149
parameters:
150150
binPath: $(DropRootPath)
151+
OfficialBuild: $(ps_official_build)
151152

152153
- template: /.pipelines/templates/step/finalize.yml@self

.pipelines/templates/windows-hosted-build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,13 +206,15 @@ jobs:
206206
- template: /.pipelines/templates/obp-file-signing.yml@self
207207
parameters:
208208
binPath: '$(Pipeline.Workspace)/Symbols_$(Architecture)'
209+
OfficialBuild: $(ps_official_build)
209210

210211
## first we sign all the files in the bin folder
211212
- ${{ if eq(variables['Architecture'], 'fxdependent') }}:
212213
- template: /.pipelines/templates/obp-file-signing.yml@self
213214
parameters:
214215
binPath: '$(GlobalToolArtifactPath)/publish/PowerShell.Windows.x64/release'
215216
globalTool: 'true'
217+
OfficialBuild: $(ps_official_build)
216218

217219
- pwsh: |
218220
Get-ChildItem '$(GlobalToolArtifactPath)/obj/PowerShell.Windows.x64/release'

build.psm1

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ function Get-EnvironmentInformation
193193
$environment += @{'IsRedHatFamily' = $environment.IsCentOS -or $environment.IsFedora -or $environment.IsRedHat}
194194
$environment += @{'IsSUSEFamily' = $environment.IsSLES -or $environment.IsOpenSUSE}
195195
$environment += @{'IsAlpine' = $LinuxInfo.ID -match 'alpine'}
196-
$environment += @{'IsMariner' = $LinuxInfo.ID -match 'mariner'}
196+
$environment += @{'IsMariner' = $LinuxInfo.ID -match 'mariner' -or $LinuxInfo.ID -match 'azurelinux'}
197197

198198
# Workaround for temporary LD_LIBRARY_PATH hack for Fedora 24
199199
# https://github.com/PowerShell/PowerShell/issues/2511
@@ -353,8 +353,8 @@ function Start-PSBuild {
353353
$PSModuleRestore = $true
354354
}
355355

356-
if ($Runtime -eq "linux-arm" -and $environment.IsLinux -and -not $environment.IsUbuntu) {
357-
throw "Cross compiling for linux-arm is only supported on Ubuntu environment"
356+
if ($Runtime -eq "linux-arm" -and $environment.IsLinux -and -not $environment.IsUbuntu -and -not $environment.IsMariner) {
357+
throw "Cross compiling for linux-arm is only supported on AzureLinux/Ubuntu environment"
358358
}
359359

360360
if ("win-arm","win-arm64" -contains $Runtime -and -not $environment.IsWindows) {
@@ -2207,6 +2207,8 @@ function Get-RedHatPackageManager {
22072207
"yum install -y -q"
22082208
} elseif ($environment.IsFedora -or (Get-Command -Name dnf -CommandType Application -ErrorAction SilentlyContinue)) {
22092209
"dnf install -y -q"
2210+
} elseif ($environment.IsMariner -or (Get-Command -Name Test-DscConfiguration -CommandType Application -ErrorAction SilentlyContinue)) {
2211+
"tdnf install -y -q"
22102212
} else {
22112213
throw "Error determining package manager for this distribution."
22122214
}
@@ -2278,8 +2280,8 @@ function Start-PSBootstrap {
22782280
# Note that when it is null, Invoke-Expression (but not &) must be used to interpolate properly
22792281
$sudo = if (!$NoSudo) { "sudo" }
22802282

2281-
if ($BuildLinuxArm -and $environment.IsLinux -and -not $environment.IsUbuntu) {
2282-
Write-Error "Cross compiling for linux-arm is only supported on Ubuntu environment"
2283+
if ($BuildLinuxArm -and $environment.IsLinux -and -not $environment.IsUbuntu -and -not $environment.IsMariner) {
2284+
Write-Error "Cross compiling for linux-arm is only supported on AzureLinux/Ubuntu environment"
22832285
return
22842286
}
22852287

0 commit comments

Comments
 (0)