Reputation: 113
I'm new to azure devops, migrating from teamcity. I use classic editor, not yaml (sorry)
Let's say we have pipeline for common library: CommonLib
And we have pipeline which build a suite of tools (all of them dependent on CommonLib): ToolsSuite
On start of this pipeline we download artifacts from CommonLib.
The thing that CommonLib
updated not frequently and we can save some time if we will build it only when it was changed.
In TeamCity I can set direct dependency and so when I manually trigger ToolsSuite
it able to see if CommonLib
was changed or no and rebuild if needed. In this way I'm sure that will get latest artifacts from CommonLib
.
I want to have same in Azure pipeline and I'm able to set trigger on ToolsSuite
pipeline for Build Completion to trigger on CommonLib
build complete. But that does not ensure at all that CommonLib
will be built by trigger during manual start of ToolsSuite
, so there is risk that we can get not latest artifacts. To solve it - we can set CommonLib
to start build when there is new pushed commits. Without this trigger we have a high risk that we will get old artifacts without any notice (unless build of tools will fail).
I just want to be 100% sure that ToolsSuite
will get latest from CommonLib
. And current approach in azure looks not safe from this point. If trigger on CommonLib
will be accidently changed by someone we might get in bad situation with ToolsSuite
use old artifacts.
Am I getting the logic of azure pipelines right ?
Should I just put build of CommonLib
as a first agent job for ToolsSuite
and have only one pipeline for it?
Thank you.
Upvotes: 2
Views: 528
Reputation: 114867
There is no way in Azure Pipeline to trigger another pipeline on-demand in case it has unbuilt changes.
The Azure Pipelines way is to do what you have described:
CommonLib
CommonLib
in the pipeline of ToolSuite
.There is no way, apart from permissions, to enforce the CI trigger on CommonLib
. This is easier to protect in YAML, as you can setup a Pull Request policy to require review changes to the YAML file.
The Download Pipeline Artifact & Download Build Artifact tasks have a Branch and a Tag filter option.
And you can add a branch-filter to the build completion trigger:
Upvotes: 1