TFS - TeamCity - Octopak - Octopus Deploy - Branching

There are a few key words to describe the issue I’m having

So I have an application that is build from many visual studio solutions deployed together to make the application run.

For example

Main Branch
|_ Solution A
|_ Project A.A
|_ Project A.B
|_ Solution B
|_ Project B.A
|_ Project B.B

Each of these projects as a .nuspec file that looks like the following

<?xml version="1.0"?> SolutionA.Project A.A SolutionA.Project A.A 1.0 My Company My Company http://.com http://< false A really useful description of the Project This release contains the following changes...

Now in Teamcity it builds these and I get Artifacts like

SolutionA.Project A.A.1.0..nupkg

from teamcity

Now over in Octopus Deploy I have a deployment configuration that

Asks for Package “SolutionA.Project A.A” and deploys it.


I create a branch of all this code and add this new branch to Teamcity to compile.

Now I get another artifact with with the same name

SolutionA.Project A.A.1.0..nupkg

If I change Project A.A in the DEV branch and go to do a deployment in Ocotopus, it will grab the one from the DEV branch rather than the one from the main branch.

So the question is how to I make sure my Octopus project only gets code from Main?

Secondly, How do I make a copy of my Ocotpus project that only pulls from DEV?


Thanks for reaching out!

In short the answer is: Have Teamcity add a pre-release tag to your non-main-branch packages like -Dev or -BranchName, and then create a set of channels in your Octopus project:

Channel Main - This channel will have a rule that says it should only pick packages without a pre-release tag (the ones from the main branch). For example SolutionA.Project A.A.1.0.1234.nupkg

Channel Dev - This channel’s rule will be to pick package with the -Dev pre-release tag on them. For example: SolutionA.Project A.A.1.0.1234-Dev.nupkg

This way, when you deploy to your Channel Dev channel, you’ll only get the packages with the -Dev pre-release tag, which should be the ones created by your Dev branch in TeamCity

If you are not familiar with our Channels concept, I recommend you to take a few mins and read this great post from Michael N: . It explains pretty much everything I mentioned above.

Please feel free to ask any questions you have about this.