Multiple TFS GIT branches on single Octopus project

I’m trying to get two TFS GIT branches to deploy to the same Octopus project/lifecycle, they both generate the same package name e.g. Test.Web BUT they each have different version numbers (assembly version).

Branch A (dev) is v 1.1
Branch B (prod) is v 1.0

Octopus completely disregards v 1.0 (older version) even if that package is the most recently deployed, I can see the packages generated under Library > Packages BUT the v 1.0.* never make it to the servers.

I’ve tried to create 2 channels each for a different version (same lifecycle) , doesn’t make a difference, the LATEST VERSION NUMBER always wins.

Any ideas?

[ADDITIONAL] Looked at the instructions @ http://docs.octopusdeploy.com/display/OD/Automatic+Release+Creation

Ensure you have enabled automatic release creation for the project based on the correct package

  • When using Channels ensure you have enabled automatic release creation for the desired Channel

Where is the “enabled automatic release creation for the desired Channel” setting located? Can’t seem to find it, I’m assuming it exists for EVERY Channel.

MANUAL FIX - I can manually trigger a release in the v1.0.* prod channel and it will deploy as expected, question is how can I automate this step without having to go to Octopus every time I check-in on that branch?

Thanks!

Hi Ivan,

Thanks for reaching out! The recommended setup for that scenario should go a bit like this:

In Octopus

  • Have 2 channels called Prod and Dev
  • Prod channel will have a versioning rule to only pick packages with version 1.0.*
  • Dev channel will have a versioning rule to only pick packages with version 1.1.*
  • Channels could use the same Lifecycle or different ones. It’ll totally depend on your needs.
  • Do not setup any kind of automatic deployments here. We’ll do that on the build server.

In TFS

  • Have 2 build definitions/config, one for your “Master” GIT branch and one for your “Dev” branch.
  • On your Master build def, have a step that creates and deploys a release to the Prod branch.
  • On your Dev build def, have a step that creates and deploys a release to the Dev branch.

You can use our TFS extension to make the release creation/deployment a lot easier from your build http://docs.octopusdeploy.com/display/OD/Use+the+Team+Foundation+Build+Custom+Task


  • By setting up those channel rules to only pick packages with a specific version, you’ll make sure that Dev will only pick package with 1.1.* and Prod package with 1.0.0, so you won't have to do this manually anymore. This will of course need to be updated once you move your **Master** branch to1.1.and your Dev branch to1.2.or even2.0.*`

  • By tying your Master branch to trigger deployments in your Prod channel, and your Dev branch to your Dev channel, all you’ll need to care about is pushing your code to the right branches in GIT, and the deployments will be triggered automatically to the right places.

Let me know how that goes,
Dalmiro

Hi Dalmiro,

Thanks for the detailed response, I’ve pretty much done all that you described. The only part that’s not working is the AUTO-DEPLOYMENT of the v 1.0.* version on one of the channels, the other Auto-Deploys.

I noticed on the TRIGGERS view under Automatic Release Creation, this setting “Create a release when a package is pushed to the built-in package repository” is CHECKED but there’s a couple of dropdowns after it where it only allows you to select a SPECIFIC step and channel. How can I make it happen for BOTH Channels? Do I need to uncheck this option?

Thanks again!

FYI

Just found here http://docs.octopusdeploy.com/display/OD/Automatic+Release+Creation that it says
"Choose the channel that will be used most commonly for automatically creating releases, and create releases manually for the other channels" which seems to say the other channels have to be MANUAL?

Thanks

Hi Ivan,

The Automatic Release Creation (ARC) feature can only work with one channel at a time.

For that reason in my approach I asked you to not setup any kind of automatic deployments here. We'll do that on the build server, and then showed you how to create the releases from your build server (instead of using ARC) so you can make use of multiple channels.

You’ll need to uncheck that option, and instead setup your build server to create and deploy the releases in Octopus.

Hope that makes sense now.

Dalmiro

Hi Dalmiro,

Got it, looks like the TFS extension seems to be the way to go.

Thanks again!