Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way for TeamCity to pass the last pinned build number into the current build's build step?

I'd like to be able to pass the last pinned build number to my TeamCity build step. I didn't see a system parameter that I could pass in, like I do with the current build number.

Is there a parameter for this that I didn't see? Or is there a way to get the version number from a URL? - thanks

like image 954
Randy Klingelheber Avatar asked Nov 25 '22 15:11

Randy Klingelheber


1 Answers

Unfortunately I haven't been unable to find a way to pass pinned build information into my TeamCity build step - which is really what I'd like to do.

The next best solution I can think of is to query TeamCity for pinned builds using their REST API. With the right query, the API will return an XML structure which would include the build number for each pinned build, amongst other useful information.

At it's simplest, the request would look something like this:

http://<buildserver>/httpAuth/app/rest/builds/?locator=pinned:true
like image 143
Randy Klingelheber Avatar answered Jun 13 '23 04:06

Randy Klingelheber