Get branch name from TeamCity build

I am deploying a nuget package which is the result of a TeamCity Feature Branch build. The build number format used includes the branch name: 1.0.0.% Build.counter% -% vcsroot.branch%.

I need a branch name on the Octopus Deploy side to set up my deployment. What's the correct way to have the branch name as a variable?

+3


source to share


1 answer


We have to parse this from the package name and set the Octopus variable using something like this

  • Create variable

Variable

  1. Create a NuGet fetch (no functions) step and PowerShell step


Steps

  1. Use PowerShell to set a variable by parsing the version number of that package

enter image description here

Hope it helps

+5


source







All Articles