0

I have a solution with two projects.

Integration.Api
Integration.Common

In Azure DevOps, I have steps which run for the Integration.Api project, I also have these build steps to create a NuGet package for the Integration.Common project:

dotnet Pack Common
dotnet Nuget Push

What do I put in the Custom condition textbox so that the step runs only if the Integration.Common project has changed? ie. I still want the build to run if Integration.Api has changed, but I only want the dotnet Pack steps to run if Integration.Common has changed. Azure DevOps

0

2 Answers 2

1

What do I put in the Custom condition textbox so that the step runs only if the Integration.Common project has changed?

There is no such out of box expressions.

But you can use a powershell script to pull out the modified files, and enables the corresponding variables, then add expressions in the custom condition textbox based on the value of variables.

Ticket: Conditional build solution in Azure DevOps

Hope this helps.

Sign up to request clarification or add additional context in comments.

Comments

0

Pretty sure you'd need to put condition on build, not on step. Put such a trigger condition on the build where you want to build common components.

trigger:
  paths:
    include:
    - /path/to/common/*

https://learn.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=azure-devops&tabs=schema#triggers

5 Comments

But I want the build to run if Integration.Api is updated.
well, then do it vice versa
I need the build to run regardless of which project changes. There are other build steps which are run before the dotnet build steps. I only want the dotnet build steps to run if Common has been updated.
Is there some way to check the last modified date of the dll? If the last modified date of Integration.Common.dll is greater than the one currently deployed then run dotnet Pack.
you need to separate this build into 2 different builds and use packages

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.