From 08662911264b137caca9b8602ccb5875bd276515 Mon Sep 17 00:00:00 2001 From: "Michael Mainer (from Dev Box)" <8527305+MIchaelMainer@users.noreply.github.com> Date: Wed, 17 Sep 2025 15:00:03 -0700 Subject: [PATCH] chore: update condition to allow manual trigger of deployment --- .azure-pipelines/ci-build.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.azure-pipelines/ci-build.yml b/.azure-pipelines/ci-build.yml index 334c9e32e82..f9043ddab8e 100644 --- a/.azure-pipelines/ci-build.yml +++ b/.azure-pipelines/ci-build.yml @@ -15,6 +15,12 @@ parameters: - name: previewBranch type: string default: "refs/heads/main" + - name: deployToGitHub + type: boolean + default: false + - name: deployToMaven + type: boolean + default: false resources: repositories: @@ -112,11 +118,12 @@ extends: targetPath: "$(PACKAGE_PATH)" - stage: deploy - condition: and(or(contains(variables['build.sourceBranch'], 'refs/tags/v'), eq(variables['build.sourceBranch'], '${{ parameters.previewBranch }}')), succeeded()) + # Allow deployment when: 1. build trigger by tag, 2. source branch matches preview branch or 3. manually triggered pipeline. All with succeeded build stage. + condition: and(or(contains(variables['build.sourceBranch'], 'refs/tags/v'), eq(variables['build.sourceBranch'], '${{ parameters.previewBranch }}'),eq(variables['Build.Reason'], 'Manual')), succeeded()) dependsOn: build jobs: - deployment: deploy_github - condition: and(contains(variables['build.sourceBranch'], 'refs/tags/v'), succeeded()) + condition: or(and(contains(variables['build.sourceBranch'], 'refs/tags/v'), succeeded()), and(eq('${{ parameters.deployToGitHub }}', 'true'), succeeded())) pool: name: Azure-Pipelines-1ESPT-ExDShared os: linux @@ -192,7 +199,7 @@ extends: - deployment: deploy_maven # snapshots are not supported by ESRP release for now, but they are planning to add support. When it happens, simply remove the condition - condition: and(contains(variables['build.sourceBranch'], 'refs/tags/v'), succeeded()) + condition: or(and(contains(variables['build.sourceBranch'], 'refs/tags/v'), succeeded()), and(eq('${{ parameters.deployToMaven }}', 'true'), succeeded())) pool: name: Azure-Pipelines-1ESPT-ExDShared os: linux