0
votes

I am doing one DevOps exercise, where I am maintaining the Code for different projects within an Azure DevOps Repo (one folder for one Project).Need to create single Release Pipeline for all.

I am trying to create a release pipeline, where I am using Artifact source as DevOps repo (because I am directly deploying ARM template, which do not require to be build). Now, I need to trigger release for change in that particular ARM folder (i.e. if change is done to Project 2).It should not be triggered, if I am doing change in Project1.

How can I achieve it?

It is feasible with Build Pipeline, becuase there we can add Path filter for respective folder. I did and that is working as expected, i.e. if I change in Project 1, only corresponding Build 1 will be triggered.

I am using classis editor for Azure DevOps release pipeline. And I do not see any option for Path filter while enabling CD trigger.

1
You may consider migrating to YAML pipeline, which you can set the trigger easily: docs.microsoft.com/en-us/azure/devops/pipelines/….Cece Dong - MSFT
Have you checked the following reply? Is it helpful?Cece Dong - MSFT

1 Answers

1
votes

There is no such out of the box solution and you need to handle it manually to detect changes in like here

$files=$(git diff HEAD HEAD~ --name-only)
$temp=$files -split ' '
$count=$temp.Length
echo "Total changed $count files"
For ($i=0; $i -lt $temp.Length; $i++)
{
  $name=$temp[$i]
  echo "this is $name file"
  if ($name -like "SubFolderA/*")
    {
      Write-Host "##vso[task.setvariable variable=MicroserviceAUpdated]True"
    }
}

then you can use this variable in custom condition on specific deployment task.