Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get Artifact Alias BuildNumber from TFS 2015

referenced here already: How to access an artifact's BUILDNUMBER is Visual Studio Team Services Release management and here: https://learn.microsoft.com/en-us/vsts/build-release/concepts/definitions/release/variables?tabs=batch

I am using vanilla Visual Studio Team Foundation Server 2015 (Version 14.102.25423.0) In my build I zip up an artifact with the buildnumber of the artifact. eg. 20171004.16.zip I have two artifact sources defined in my release definition.

"QA - myproject - build"
"Prod - myproject - build"

One of my steps is to copy the buildnumber.zip file to my remote server. in my configuration setting I have defined:

ProdBuildNumber = $(Release.Artifacts.Prod - myproject - build.BuildNumber)

The issue is that ProdBuildNumber just keeps getting set as that literally. eg: from debug script:

...
2017-10-05T19:09:48.0651172Z [SYSTEM] --> [release]
2017-10-05T19:09:48.0651172Z [PRODBUILDNUMBER] --> [$(Release.Artifacts.Prod - myproject - build.BuildNumber)]
2017-10-05T19:09:48.0651172Z [RELEASE_RELEASEID] --> [114]
...

Can anyone see what I am doing incorrectly? Willing to try any ideas.

like image 402
macm Avatar asked Nov 18 '25 11:11

macm


1 Answers

Try

ProdBuildNumber = $(Release.Artifacts.Prod) - myproject - $(build.BuildNumber)
like image 59
orhtej2 Avatar answered Nov 21 '25 08:11

orhtej2



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!