Setting up multiple builds with the same release process

I am trying to have 2 teamcity build plans trigger a release with the same Octopus process.

for the most part this works, but I run into an issue where the nuget package semantic versioning is causing a problem.

Attached diagram shows how both Master and RC branches will trigger a build, into different environments.

I know I can achieve this by creating 2 separate processes, but I am hoping to re-use just one process for this.

the problem I have is that I have a different semantic version setup for RC branch

Master Version: 1.1.1.%build number%
RC Version: 2600.1.1.%build number%

this is so I can tell which build the assemblies (nuget) came from.

however Octopus always takes the latest sem version, meaning, packages are ordered by version (not by publish date) so when master triggers a new release (i.e. 1.1.1.256) the release will take the 2600.1.1.7 because it’s semantic version is higher (even though that is not what triggered the release).

I need a way to tell Octopus to release the nuget package that was just built, NOT the highest sem ver package that exists.

I think I found one solution, by adding a --packageVersion parameter in Octopus Create Release step.

I pasted the same version there as what was used in first step

in my master branch team city final step for octopus release:

additional parameters: --packageVersion=1.1.%build.number%

Hi,

Thanks for getting in touch.
I’m glad to see that you have found a solution.

You can also use channels to achieve what you need. The linked blog post describes a number of scenarios, which may be helpful for you.

Let me know how you go.

Regards
Ben

Hi,

One further note to my previous reply: one caveat to watch out for when setting up a feature branch channel is you must add a regex package exclusion for non-production releases to the default channel - https://octopus.com/blog/channels-walkthrough#step-1-prevent-pre-release-packages-from-being-deployed-to-produ

Regards
Ben