Octopus not using the Version being sent it by TeamCity

I have to sets of build configurations. One set for Master branch. One set for feature branches.

The most recent build for master is 1.1.377.

The most recent build for feature config is 1.0.17-stackify-int-0c95d50

Below you can see the output from team city. It’s sending the correct version to Octopus, but for some reason Octopus ignores it and is using the last build it got from the master build config.

I’ve confirmed that the TeamCity artifacts directory has the correct code compiled into nuget packages for this version: 1.0.17-stackify-int-0c95d50

What might be the cause?

See logs below

[08:50:35]Updating sources: server side checkout
[08:50:35]Step 1/2: OctopusDeploy: Create release (5s)
[08:50:36][Step 1/2] Octopus Deploy (4s)
[08:50:36][Octopus Deploy] Running command:   octo.exe create-release --server http://octopus.fl.com --apikey SECRET --project FL --enableservicemessages --version 1.0.17-stackify-int-0c95d50
[08:50:36][Octopus Deploy] Creating Octopus Deploy release
[08:50:36][Octopus Deploy] Octopus Deploy Command Line Tool, version 2.6.3.60
[08:50:36][Octopus Deploy] 
[08:50:37][Octopus Deploy] Handshaking with Octopus server: http://octopus.fl.com
[08:50:38][Octopus Deploy] Handshake successful. Octopus version: 3.1.4; API version: 3.0.0
[08:50:38][Octopus Deploy] Finding project: fl
[08:50:38][Octopus Deploy] Finding deployment process for project: fl
[08:50:38][Octopus Deploy] Finding release template...
[08:50:38][Octopus Deploy] Resolving NuGet package versions...
[08:50:38][Octopus Deploy] Finding latest NuGet package for step: Deploy Database Migrations
[08:50:38][Octopus Deploy] Finding latest NuGet package for step: Deploy Dugout
[08:50:39][Octopus Deploy] Finding latest NuGet package for step: Deploy WWW
[08:50:39][Octopus Deploy] Finding latest NuGet package for step: Deploy Team
[08:50:39][Octopus Deploy] Finding latest NuGet package for step: Deploy Athlete
[08:50:40][Octopus Deploy] Finding latest NuGet package for step: Deploy Worker
[08:50:40][Octopus Deploy] Using version number provided on command-line.
[08:50:40][Octopus Deploy] Release plan for release:    1.0.17-stackify-int-0c95d50
[08:50:40][Octopus Deploy] Steps: 
[08:50:40][Octopus Deploy]   #   Name                         Version         Source                              
[08:50:40][Octopus Deploy]   --- ---------------------------- --------------- ------------------------------------
[08:50:40][Octopus Deploy]   1   Deploy Database Migrations   1.1.377         Latest available in NuGet repository
[08:50:40][Octopus Deploy]   2   Deploy Dugout                1.1.377         Latest available in NuGet repository
[08:50:40][Octopus Deploy]   3   Deploy WWW                   1.1.377         Latest available in NuGet repository
[08:50:40][Octopus Deploy]   4   Deploy Team                  1.1.377         Latest available in NuGet repository
[08:50:40][Octopus Deploy]   5   Deploy Athlete               1.1.377         Latest available in NuGet repository
[08:50:40][Octopus Deploy]   6   Deploy Worker                1.1.377         Latest available in NuGet repository
[08:50:40][Octopus Deploy] 
[08:50:40][Octopus Deploy] Creating release...
[08:50:40][Octopus Deploy] Release 1.0.17-stackify-int-0c95d50 created successfully!
[08:50:40][Octopus Deploy] ##teamcity[setParameter name='octo.releaseNumber' value='1.0.17-stackify-int-0c95d50']
[08:50:40][Octopus Deploy] Octo.exe exit code: 0
[08:50:41]Step 2/2: Deploy Releases (OctopusDeploy: Deploy release) (5m:15s)
[08:55:04][Octopus Deploy] Success: Step 5: Deploy Athlete
[08:55:15][Octopus Deploy] Success: Step 3: Deploy WWW
[08:55:25][Octopus Deploy] Success: Step 4: Deploy Team
[08:55:56][Octopus Deploy] Success: Step 10: Deploy Worker
[08:55:56]Publishing internal artifacts

Hi,

Thanks for getting in touch! When you package files with TeamCity and use its internal repository, it doesn’t release the artifacts to its repository until EVERYTHING is done with the build step.
If you see the last lines of your log:

[08:55:56][Octopus Deploy] Success: Step 10: Deploy Worker
[08:55:56]Publishing internal artifacts

So you either need to use another feed (such as the Octopus internal feed) or create a second build that is triggered to run after the first, so Octopus has the desired files to work with, as they haven’t been released yet.

Hope that helps!
Vanessa

Hi Vanessa,

I have 2 “build configurations” the first one does the build, then I have a
2nd dependent build configuration that is in charge of creating the release
on Octopus & deploying it to Octopus.

2 questions.

  1. If I tell octopus to deploy a given version, and it can’t find it, why
    would it not break instead of deploying some other version. Why is it
    just deploy 1.1.377? Shouldn’t it break?

  2. Since we have 2 separate build configurations, why is this an issue?
    I have a duplicate setup, the only difference being that it monitors the
    master branch, (which is where the 1.1.377 points to) and that one works
    fine.

Does something else need to be done in TeamCity to let Octopus know about
this separate set of build configurations?

-Mark

Hi Mark,

  1. You define --version 1.0.17-stackify-int-0c95d50 - this is defining the release version, if you want to define the package version that a release uses you need to also specify --packageversion http://docs.octopusdeploy.com/display/OD/Creating+releases
    If you don’t specify we use the latest thats available.

  2. You are running everything from TeamCity. TeamCity doesnt release artifacts until the very end of single processes. Octopus doesn’t care what you do in TeamCity, Octopus doesn’t know about TeamCity - you just need to get your ordering correct.
    We have some great videos that explain it all. https://octopus.com/videos
    I suggest you watch the ‘Triggering deployments from TeamCity’ video where it is explained why you need two.

Vanessa