1
votes

I'd like to update a variable in a linked variable group with $(Build.BuildId) from a Linux pipeline. I see a few examples using the @echo ##vso[task.setvariable command, but can't get it to work because I don't think I'm referencing the source or destination right.

The linked variable group is NightlyBuildID and the variable is LinuxBuildID.

Here's one of my many attempts: @echo ##vso[task.setvariable variable=LinuxBuildID]$(Build.BuildId)

2

2 Answers

1
votes

The $(variable) syntax is only valid within the build editor interface. Within a script, you have to reference it as an environment variable. Periods are replaced with underscores.

Thus, in Linux, $(Build.BuildId) would be accessed as $BUILD_BUILDID.

0
votes