Sven-Michael Stübe
Sven-Michael Stübe

Reputation: 14760

TFS CI build trigger include variable

Is it possible to use a variable as build trigger? I've tried and the build doesn't get triggered. If I remove the variable and insert a value, the build gets triggered as expected.

Aren't variables allowed here? $(Mapping.ServerPath) is set to MyRepo/Branches/MyBranch. $/MyRepo/Branches/MyBranch triggers the build correctly.

enter image description here

Upvotes: 2

Views: 964

Answers (3)

We have a microservice architecture with dozens of builds, it makes sense to be able to use a variable that we can update when we start our next iteration. With our branching strategy we have a new branch for each sprint and for each release. Changing the CI trigger in every build every couple weeks is inefficient.

We are using on premise TFS2018 and from everything I've seen this is not supported.

Upvotes: 0

Martin van Delft
Martin van Delft

Reputation: 457

No. And why should they?

The specified path results in a poll action being performed on the static path. You can use wildcards if needed. The build should trigger on a change, hence CI trigger.

Making the path a variable, when would you provide it? If it's just keeping a static value elsewhere, why not fill it in? If you want to provide the path when calling the build. Then you don't intend to use the CI option as intended?

Upvotes: 2

starian chen-MSFT
starian chen-MSFT

Reputation: 33738

No, it is not supported.

There is a user voice that you can follow: Allow Variables in Repository, variables and triggers Tab.

Upvotes: 0

Related Questions