From d0fc7fcc2072faf56d89d1c0499424a61cec8670 Mon Sep 17 00:00:00 2001 From: Djuradj Kurepa Date: Wed, 1 Jul 2026 10:10:21 +0200 Subject: [PATCH 1/2] Continue on docker build errors --- eng/docker-tools/templates/stages/build-and-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/docker-tools/templates/stages/build-and-test.yml b/eng/docker-tools/templates/stages/build-and-test.yml index d21e8de90..5ea4b4b36 100644 --- a/eng/docker-tools/templates/stages/build-and-test.yml +++ b/eng/docker-tools/templates/stages/build-and-test.yml @@ -212,7 +212,7 @@ stages: ################################################################################ - stage: Post_Build dependsOn: Build - condition: and(succeeded(), contains(variables['stages'], 'build')) + condition: and(succeededOrFailed(), contains(variables['stages'], 'build')) jobs: - template: /eng/docker-tools/templates/jobs/post-build.yml@self parameters: From 3aa214c87d33410d67561dde525747dcc53eadd3 Mon Sep 17 00:00:00 2001 From: Djuradj Kurepa Date: Wed, 1 Jul 2026 15:32:54 +0200 Subject: [PATCH 2/2] Add a runPostBuildOnFailure parameter to optionally continue on build errors --- eng/docker-tools/templates/stages/build-and-test.yml | 7 ++++++- .../templates/stages/dotnet/build-and-test.yml | 3 +++ .../templates/stages/dotnet/build-test-publish-repo.yml | 3 +++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/eng/docker-tools/templates/stages/build-and-test.yml b/eng/docker-tools/templates/stages/build-and-test.yml index 5ea4b4b36..a03804aa8 100644 --- a/eng/docker-tools/templates/stages/build-and-test.yml +++ b/eng/docker-tools/templates/stages/build-and-test.yml @@ -15,6 +15,8 @@ parameters: customBuildInitSteps: [] customTestInitSteps: [] sourceBuildPipelineRunId: "" + # When true, the Post-Build stage runs even if the Build stage failed (succeededOrFailed). + runPostBuildOnFailure: false linuxAmdBuildJobTimeout: 60 linuxArmBuildJobTimeout: 60 @@ -212,7 +214,10 @@ stages: ################################################################################ - stage: Post_Build dependsOn: Build - condition: and(succeededOrFailed(), contains(variables['stages'], 'build')) + ${{ if eq(parameters.runPostBuildOnFailure, true) }}: + condition: and(succeededOrFailed(), contains(variables['stages'], 'build')) + ${{ else }}: + condition: and(succeeded(), contains(variables['stages'], 'build')) jobs: - template: /eng/docker-tools/templates/jobs/post-build.yml@self parameters: diff --git a/eng/docker-tools/templates/stages/dotnet/build-and-test.yml b/eng/docker-tools/templates/stages/dotnet/build-and-test.yml index a9e8f05fd..5b7e23379 100644 --- a/eng/docker-tools/templates/stages/dotnet/build-and-test.yml +++ b/eng/docker-tools/templates/stages/dotnet/build-and-test.yml @@ -21,6 +21,8 @@ parameters: # Build parameters noCache: false publishConfig: null + # When true, the Post-Build stage runs even if the Build stage failed. + runPostBuildOnFailure: false buildMatrixType: platformDependencyGraph buildMatrixCustomBuildLegGroupArgs: "" linuxAmdBuildJobTimeout: 60 @@ -47,6 +49,7 @@ stages: parameters: noCache: ${{ parameters.noCache }} publishConfig: ${{ parameters.publishConfig }} + runPostBuildOnFailure: ${{ parameters.runPostBuildOnFailure }} internalProjectName: ${{ parameters.internalProjectName }} publicProjectName: ${{ parameters.publicProjectName }} storageAccountServiceConnection: ${{ parameters.storageAccountServiceConnection }} diff --git a/eng/docker-tools/templates/stages/dotnet/build-test-publish-repo.yml b/eng/docker-tools/templates/stages/dotnet/build-test-publish-repo.yml index eaf153c2c..155dad20f 100644 --- a/eng/docker-tools/templates/stages/dotnet/build-test-publish-repo.yml +++ b/eng/docker-tools/templates/stages/dotnet/build-test-publish-repo.yml @@ -13,6 +13,8 @@ parameters: # Build parameters noCache: false publishConfig: null + # When true, the Post-Build stage runs even if the Build stage failed. + runPostBuildOnFailure: false buildMatrixType: platformDependencyGraph buildMatrixCustomBuildLegGroupArgs: "" linuxAmdBuildJobTimeout: 60 @@ -55,6 +57,7 @@ stages: # Build noCache: ${{ parameters.noCache }} publishConfig: ${{ parameters.publishConfig }} + runPostBuildOnFailure: ${{ parameters.runPostBuildOnFailure }} buildMatrixType: ${{ parameters.buildMatrixType }} buildMatrixCustomBuildLegGroupArgs: ${{ parameters.buildMatrixCustomBuildLegGroupArgs }} linuxAmdBuildJobTimeout: ${{ parameters.linuxAmdBuildJobTimeout }}