0

I have 7 projects in one .sln. I am using azure devops. There is 4 api and 3 web. I have created two different pipeline for api and web. When commit then both pipeline is triggered.

What I want....

I want only changes project will trigger, build and release. If project 1 is changes then only build and release project 1. Others no.

How do I manage this?

Currently for one change all projects are building and releasing.

Noor All Safaet
  • 438
  • 6
  • 19
  • Does this issue still block you? And which pipeline do you use, Classic build+Classic release pipeline or yaml multi-stage pipeline for both build and release? – LoLance Jun 02 '20 at 08:01
  • @LanceLi-MSFT Little bit configured in YAML but most of the parts are configured from UI. – Noor All Safaet Jun 02 '20 at 16:43

2 Answers2

1

Update your includes path in the pipeline.

  paths:
    include:
    - /Project1FolderName/*
    - /Project2FolderName/*
DreadedFrost
  • 2,602
  • 1
  • 11
  • 29
  • @Dreaedfrost can you explain please? If I add include path what will be the benefit? – Noor All Safaet May 30 '20 at 11:49
  • The paths include will tell your yaml pipelines what path of files to be associated with your build. I'd have one for your web projects and one pipeline for your API projects. So you'd have two pipelines with the same trigger being master but looking at different paths for including in builds and triggers. [Here is another answer that someone posted]( https://stackoverflow.com/questions/59584717/multiple-separate-triggers-in-azure-pipelines-yml) – DreadedFrost May 30 '20 at 19:00
1

Firts of all, if you want only the project you change to trigger the pipeline, you have to create one "pipeline->release" for each project.

When I want something like this normally I create a pipeline whith my build template and then change the trigger option:

Go to edit your pipeline:

enter image description here

And then add the path of the project you want to trigger this pipeline.

enter image description here

So with this you will have a diferent artifact for each project and you will be able to have release only the project you push your changes.

I hope this work for you too!

  • @Aacho Martínez-Aedo So will I create 7 pipelines for each project? – Noor All Safaet May 30 '20 at 15:53
  • @Noor All Safaet you will have one pipeline for each project, if that its what you need. Or one pipeline for the APIs and one for the webs, that's depends of what you want. – Nacho Martínez-Aedo May 30 '20 at 23:06
  • @Aacho Martínez-Aedo I have common class library in that what will I do? If I include filter path then only selected path is triggering, if changed from common class libraries then what will I do? If I include path all reference class libraries then it will work I believe but those class libraries also are using in another project but same solution in that case other projects also triggered? – Noor All Safaet Jun 08 '20 at 17:16