@@ -15,6 +15,12 @@ parameters:
1515 - name : previewBranch
1616 type : string
1717 default : " refs/heads/main"
18+ - name : deployToGitHub
19+ type : boolean
20+ default : false
21+ - name : deployToMaven
22+ type : boolean
23+ default : false
1824
1925resources :
2026 repositories :
@@ -112,11 +118,12 @@ extends:
112118 targetPath : " $(PACKAGE_PATH)"
113119
114120 - stage : deploy
115- condition : and(or(contains(variables['build.sourceBranch'], 'refs/tags/v'), eq(variables['build.sourceBranch'], '${{ parameters.previewBranch }}')), succeeded())
121+ # Allow deployment when: 1. build trigger by tag, 2. source branch matches preview branch or 3. manually triggered pipeline. All with succeeded build stage.
122+ condition : and(or(contains(variables['build.sourceBranch'], 'refs/tags/v'), eq(variables['build.sourceBranch'], '${{ parameters.previewBranch }}'),eq(variables['Build.Reason'], 'Manual')), succeeded())
116123 dependsOn : build
117124 jobs :
118125 - deployment : deploy_github
119- condition : and(contains(variables['build.sourceBranch'], 'refs/tags/v'), succeeded())
126+ condition : or( and(contains(variables['build.sourceBranch'], 'refs/tags/v'), succeeded()), and(eq('${{ parameters.deployToGitHub }}', 'true'), succeeded() ))
120127 pool :
121128 name : Azure-Pipelines-1ESPT-ExDShared
122129 os : linux
@@ -192,7 +199,7 @@ extends:
192199
193200 - deployment : deploy_maven
194201 # snapshots are not supported by ESRP release for now, but they are planning to add support. When it happens, simply remove the condition
195- condition : and(contains(variables['build.sourceBranch'], 'refs/tags/v'), succeeded())
202+ condition : or( and(contains(variables['build.sourceBranch'], 'refs/tags/v'), succeeded()), and(eq('${{ parameters.deployToMaven }}', 'true'), succeeded() ))
196203 pool :
197204 name : Azure-Pipelines-1ESPT-ExDShared
198205 os : linux
0 commit comments