Skip to content

Commit

Permalink
Use variables for container values (#45490)
Browse files Browse the repository at this point in the history
  • Loading branch information
ellahathaway authored Dec 17, 2024
1 parent 6ac6af9 commit 5b909c0
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 52 deletions.
2 changes: 1 addition & 1 deletion eng/pipelines/templates/jobs/vmr-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ jobs:
${{ if ne(parameters.container.image, '') }}:
container:
image: ${{ parameters.container.image }}
options: --privileged
options: $(defaultContainerOptions)

# Currently, CodeQL slows the build down too much
# https://github.com/dotnet/source-build/issues/4276
Expand Down
3 changes: 3 additions & 0 deletions eng/pipelines/templates/variables/vmr-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ variables:
- name: VmrBranch
value: ${{ replace(replace(variables['Build.SourceBranch'], 'refs/heads/', ''), 'refs/pull/', '') }}

- name: defaultContainerOptions
value: --privileged

- name: almaLinuxContainerName
value: almaLinuxContainer
- name: almaLinuxContainerImage
Expand Down
103 changes: 52 additions & 51 deletions src/SourceBuild/content/eng/pipelines/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ variables:
value: ${{ eq(variables['Build.Reason'], 'PullRequest') }}

- template: /eng/common/templates-official/variables/pool-providers.yml@self
- template: /src/sdk/eng/pipelines/templates/variables/vmr-build.yml@self

resources:
repositories:
Expand Down Expand Up @@ -78,57 +79,57 @@ extends:
baselineFile: $(Build.SourcesDirectory)\.config\guardian\.gdnbaselines

containers:
almaLinuxContainer:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:almalinux-8-source-build
options: --privileged
alpineLatestContainer:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.21-amd64
options: --privileged
alpinePreviousContainer:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.20-withnode
options: --privileged
centOSStreamContainer:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream9
options: --privileged
fedoraContainer:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:fedora-41
options: --privileged
ubuntuContainer:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-24.04
options: --privileged
ubuntuArmContainer:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-24.04-arm64
options: --privileged
azurelinuxX64CrossContainer:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net9.0-cross-amd64
options: --privileged
azurelinuxArmCrossContainer:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net9.0-cross-arm
options: --privileged
azurelinuxArm64CrossContainer:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net9.0-cross-arm64
options: --privileged
azurelinuxX64AlpineCrossContainer:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net9.0-cross-amd64-alpine
options: --privileged
azurelinuxArmAlpineCrossContainer:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net9.0-cross-arm-alpine
options: --privileged
azurelinuxArm64AlpineCrossContainer:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net9.0-cross-arm64-alpine
options: --privileged
androidCrossContainer:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net9.0-cross-android-amd64
options: --privileged
linuxBionicCrossContainer:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net9.0-android-openssl
options: --privileged
browserCrossContainer:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net9.0-webassembly-amd64
options: --privileged
wasiCrossContainer:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net9.0-webassembly-amd64
options: --privileged
${{ variables.almaLinuxContainerName }}:
image: ${{ variables.almaLinuxContainerImage }}
options: ${{ variables.defaultContainerOptions }}
${{ variables.alpineLatestContainerName }}:
image: ${{ variables.alpineLatestContainerImage }}
options: ${{ variables.defaultContainerOptions }}
${{ variables.alpinePreviousContainerName }}:
image: ${{ variables.alpinePreviousContainerImage }}
options: ${{ variables.defaultContainerOptions }}
${{ variables.centOSStreamContainerName }}:
image: ${{ variables.centOSStreamContainerImage }}
options: ${{ variables.defaultContainerOptions }}
${{ variables.fedoraContainerName }}:
image: ${{ variables.fedoraContainerImage }}
options: ${{ variables.defaultContainerOptions }}
${{ variables.ubuntuContainerName }}:
image: ${{ variables.ubuntuContainerImage }}
options: ${{ variables.defaultContainerOptions }}
${{ variables.ubuntuArmContainerName }}:
image: ${{ variables.ubuntuArmContainerImage }}
options: ${{ variables.defaultContainerOptions }}
${{ variables.azurelinuxX64CrossContainerName }}:
image: ${{ variables.azurelinuxX64CrossContainerImage }}
options: ${{ variables.defaultContainerOptions }}
${{ variables.azurelinuxArmCrossContainerName }}:
image: ${{ variables.azurelinuxArmCrossContainerImage }}
options: ${{ variables.defaultContainerOptions }}
${{ variables.azurelinuxArm64CrossContainerName }}:
image: ${{ variables.azurelinuxArm64CrossContainerImage }}
options: ${{ variables.defaultContainerOptions }}
${{ variables.azurelinuxX64AlpineCrossContainerName }}:
image: ${{ variables.azurelinuxX64AlpineCrossContainerImage }}
options: ${{ variables.defaultContainerOptions }}
${{ variables.azurelinuxArmAlpineCrossContainerName }}:
image: ${{ variables.azurelinuxArmAlpineCrossContainerImage }}
options: ${{ variables.defaultContainerOptions }}
${{ variables.azurelinuxArm64AlpineCrossContainerName }}:
image: ${{ variables.azurelinuxArm64AlpineCrossContainerImage }}
options: ${{ variables.defaultContainerOptions }}
${{ variables.androidCrossContainerName }}:
image: ${{ variables.androidCrossContainerImage }}
options: ${{ variables.defaultContainerOptions }}
${{ variables.linuxBionicCrossContainerName }}:
image: ${{ variables.linuxBionicCrossContainerImage }}
options: ${{ variables.defaultContainerOptions }}
${{ variables.browserCrossContainerName }}:
image: ${{ variables.browserCrossContainerImage }}
options: ${{ variables.defaultContainerOptions }}
${{ variables.wasiCrossContainerName }}:
image: ${{ variables.wasiCrossContainerImage }}
options: ${{ variables.defaultContainerOptions }}

stages:
- ${{ if and(ne(variables.isPRTrigger, 'true'), eq(variables['System.TeamProject'], 'internal')) }}:
Expand Down

0 comments on commit 5b909c0

Please sign in to comment.