How to choose the correct package version? (TeamCity, OctoPack, multiple deploy environments)


We are building packages for multiple deployment environments using TeamCity server and OctoPack. The problem is that tentacle agent chooses the latest by number version of the package, so it’s the same (latest) package that is deployed on all environments. Here’s the summary of our setup:

  • Environments DEV and STAGE;
  • Deployment to DEV is triggered from Git “dev” branch
  • Deployment to STAGE is triggered from Git “stage” branch
  • OctoPack is configured to generate packages for DEV build configuration
  • OctoPack is configured to generate packages MyProduct.1.0.0.%build_counter% for STAGE build configuration
  • TeamCity is configured to expose OctoPack artefacts (NuGet packages) via its NuGet feed
  • Octopus project is configured to deploy packages with NuGet Id MyProduct from TeamCity NuGet feed

So what happens is that since DEV builds are run more frequently, they have larger %build_counter%, and STAGE doesn’t get a chance to get a deployment of its own packages - Octopus tentacle preferes packages with* suffix.

This must be fairly common scenario, but I haven’t found a simple way to solve it. Any hints are appreciated.


Hi Vagif,

The package versions can be set when releases are created - what do you currently use to create them (e.g. do you use our TeamCity plugin?)

Via the Octopus UI, typing in the package number may be your only option in this scenario. All of the automated release creation options however should let you specify package versions explicitly, e.g. by deriving them from a TC variable.

Hope this helps,

Hi Nicholas,

Thank you for the info. We are now specifying the explicit package version, and it works fine.