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 MyProduct.1.0.0.dev-%build_counter% for DEV build configuration;
- OctoPack is configured to generated 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 1.0.0.dev-* suffix.
This must be fairly common scenario, but I haven't found a simple way to solve it.