CI/CD Deployment Conditions Not Triggering

Viewed 1614

I've been fighting with this for over a day now. I have a simple requirement inside of a VSTS CI/CD pipeline that I'm trying to build that any branch following the pattern release/* or hotfix/* should trigger a deployment to my QA environment. Here is my branch based configuration:

enter image description here

This configuration does not trigger the deployment as expected. As you can see in the screenshot below the release ran but did not trigger against any of my environments. (QA is the second grey square from the right and should be green or red depending on whether the deployment succeeded or failed).

enter image description here

In an attempt to work around this, I tried using Build Tags instead. I added a Powershell step that conditionally adds Build Tags based on the name of the branch.

$branchName = $Env:BUILD_SOURCEBRANCH

if ($branchName -like '*release/*')
{
    Write-Host "##vso[build.addbuildtag]release"
}

if ($branchName -like '*hotfix/*')
{
    Write-Host "##vso[build.addbuildtag]hotfix"
}

This correctly sets the Build Tags as I can see right on the build artifact and in logs that the tag was applied. However, modifying my Deployment Conditions to be Tag aware results in exactly the same behavior as my attempt using branches:

enter image description here enter image description here

EDIT: As requested, here is the CI definition with the Get Sources step shown. There is no option to add multiple branch conditions here. They are set in the Triggers section.

Get Sources CI Config CI Triggers

1 Answers
Related