Octo.exe create-release with Project doesn't match channels

I’m trying to set up the following workflows from our build server (TeamCity) in to Octopus, allowing appropriate deployments into the correct environments:

  • Builds from Feature branches - can only be deployed to our Development Environments - packages are tagged with branch name.
  • Builds from Develop branch - can be deployed to Development, QA, and client UAT environment - packages are tagged with “develop”.
  • Release builds from Release branches - can be deployed through all environments up to production - packages are tagged with “release”.

I’ve defined some channels within one of my projects and was hoping that creating releases from our TeamCity builds would honour the channels when I push them into Octopus - however this doesn’t seem to be the case:

Running command:   octo.exe create-release --server http://octopus.example.com/octopus --apikey SECRET --project projectName --enableservicemessages --version 1.0.1208-develop --packageversion=1.0.1208-develop
Creating Octopus Deploy release
Octopus Deploy Command Line Tool, version 3.3.2+Branch.master.Sha.497e7f8ef2b193cd33560217bfecc38d721029a5

Handshaking with Octopus server: http://octopus.example.com/octopus
Handshake successful. Octopus version: 3.2.24; API version: 3.0.0
Authenticated as: OctoPack <> 
Finding project: projectName
Finding deployment process for project: projectName
Finding release template...
Using version number provided on command-line.
Release plan for release:    1.0.1208-develop
Steps: 
  #   Name                           Version         Source                              
  --- ------------------------------ --------------- ------------------------------------
  1   Deploy to Azure Cloud Service  1.0.1208-develop User specified                      
Creating release...
Error from Octopus server (HTTP 400): There was a problem with your request.

 - The requested package versions for the following steps violate the channel version rules: Deploy to Azure Cloud Service. Please specify a different package version, channel or provide the `ignoreChannelRules` parameter to override this check.

Exit code: -7
Octo.exe exit code: -7

Unlike with the Automatic Release Creation, I am specifying a project name, and this is found as expected within Octopus - however because the package name does not match the “Default” requirements (but does match a different channel release) it should go into the appropriate channel.

In an ideal world, builds from feature or develop would result in a release in Octopus, within the correct channel As it stands, I’m going to have either one branch failing because I couldn’t create the release, or look at creating another build process for feature branches that doesn’t push to Octopus?

Hi Ben,

Thanks for getting in touch! We agree that it should be smarter to match versions with rules and define the channel. Right now this is at a suggestion stage so please go and add your votes and comment: https://octopusdeploy.uservoice.com/forums/170787-general/suggestions/10920663-let-octo-exe-auto-select-the-right-channel-when-cr
So far it doesn’t have many votes.

The current workaround is to define the channel in the command.

Vanessa