3

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

I need branch name at Octopus Deploy side to customize my deploy. What is the right way to have branch name as a Variable?

tspauld
  • 3,512
  • 2
  • 25
  • 22
SiberianGuy
  • 24,674
  • 56
  • 152
  • 266
  • You would like to get something like: 1.0.0.1-develop? – Rob May 14 '15 at 10:01
  • @Rob, I already have it. So my packages are named like Web.1.0.0.1-develop. What I'd like is to have "develop" as a variable in Octopus Deploy so I know which branch is being deployed (and execute deploy appropriately) – SiberianGuy May 14 '15 at 10:43

1 Answers1

6

We should be able to parse this out from the Package Name and set an Octopus Variable using something like this

  1. Create the variable

Variable

  1. Create a step to extract the NuGet (no features) and a PowerShell step

Steps

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

enter image description here

Hope this helps

Matt
  • 3,684
  • 1
  • 17
  • 19