From 492bd41a253de8f7c2b88fee3b51d0a75ecdbb43 Mon Sep 17 00:00:00 2001 From: Matt Thalman Date: Wed, 15 Oct 2025 08:23:09 -0500 Subject: [PATCH] Add noCache parameter to pipelines --- eng/pipelines/dotnet-buildtools-prereqs-official.yml | 10 ++++++++++ eng/pipelines/dotnet-buildtools-prereqs-unofficial.yml | 10 ++++++++++ eng/pipelines/stages/dotnet-buildtools-prereqs.yml | 6 ++++++ 3 files changed, 26 insertions(+) diff --git a/eng/pipelines/dotnet-buildtools-prereqs-official.yml b/eng/pipelines/dotnet-buildtools-prereqs-official.yml index 45367fca..9d8f30dc 100644 --- a/eng/pipelines/dotnet-buildtools-prereqs-official.yml +++ b/eng/pipelines/dotnet-buildtools-prereqs-official.yml @@ -22,6 +22,15 @@ parameters: type: string default: $(Build.BuildId) +- name: noCache + displayName: > + Run build with no cache. When this is unchecked, the build will use the + info in the dotnet/versions repo to build only the images which have had + Dockerfile changes or base images updates. When this is checked, all images + will be built regardless of caching status. + type: boolean + default: false + schedules: - cron: "0 5 1,15 * *" displayName: Monthly rebuild of all images @@ -60,3 +69,4 @@ extends: parameters: sourceBuildPipelineRunId: ${{ parameters.sourceBuildPipelineRunId }} publishConfigTemplatePath: /eng/common/templates/stages/dotnet/publish-config-prod.yml@self + noCache: ${{ parameters.noCache }} diff --git a/eng/pipelines/dotnet-buildtools-prereqs-unofficial.yml b/eng/pipelines/dotnet-buildtools-prereqs-unofficial.yml index ada07a71..f6545a1b 100644 --- a/eng/pipelines/dotnet-buildtools-prereqs-unofficial.yml +++ b/eng/pipelines/dotnet-buildtools-prereqs-unofficial.yml @@ -16,6 +16,15 @@ parameters: type: string default: $(Build.BuildId) +- name: noCache + displayName: > + Run build with no cache. When this is unchecked, the build will use the + info in the dotnet/versions repo to build only the images which have had + Dockerfile changes or base images updates. When this is checked, all images + will be built regardless of caching status. + type: boolean + default: false + variables: - template: /eng/pipelines/variables/common.yml@self parameters: @@ -43,3 +52,4 @@ extends: parameters: sourceBuildPipelineRunId: ${{ parameters.sourceBuildPipelineRunId }} publishConfigTemplatePath: /eng/common/templates/stages/dotnet/publish-config-nonprod.yml@self + noCache: ${{ parameters.noCache }} diff --git a/eng/pipelines/stages/dotnet-buildtools-prereqs.yml b/eng/pipelines/stages/dotnet-buildtools-prereqs.yml index 9a52cdf9..9b88fd2d 100644 --- a/eng/pipelines/stages/dotnet-buildtools-prereqs.yml +++ b/eng/pipelines/stages/dotnet-buildtools-prereqs.yml @@ -3,6 +3,10 @@ parameters: type: string default: $(Build.BuildId) +- name: noCache + type: boolean + default: false + - name: publishConfigTemplatePath type: string @@ -38,6 +42,8 @@ stages: # See https://github.com/dotnet/dotnet-buildtools-prereqs-docker/issues/1224 ${{ if eq(variables['Build.Reason'], 'Schedule') }}: noCache: true + ${{ else }}: + noCache: ${{ parameters.noCache }} ${{ if contains(variables['Build.DefinitionName'], '-official') }}: additionalServiceConnections: - name: $(marStatus.serviceConnectionName)