Can't create release. Package versions could not be resolved

Hi all

First I want to tell you what I have and what I want to do.

TFS + TeamCity 9.0.3 (build 32334) + Octopus Deploy 3.0.20.0

  1. Lifecycle: - http://prntscr.com/8bo5j6
  2. Environments: http://prntscr.com/8bo6tw
  3. Each project have two steps - Staging: http://prntscr.com/8bo7sr and Production: http://prntscr.com/8bo82a
  4. I’m using TeamCity. That’s my build steps: NuGet Installer (takes last build from TFS) -> MSBuild (command line params: http://prntscr.com/8bo8tp and http://prntscr.com/8bo9rg) -> Octopus Create Release (additional params: http://prntscr.com/8bo98m) -> Octopus Deploy Release (additional params: http://prntscr.com/8bo9ez)
    So, TC creates two nupkg files in two different TC build configurations: for Staging (Project.Debug.{version}.nupkg) and for Production (ProjectName.Release.{version}.nupkg)

So what the problem is?
TC build log: http://prntscr.com/8bocdb
Here is the problem: I can’t create Staging release without Production nupkg file?

What the ways I have to resolve this problem?

  1. I can create Production step just before the Production deploy
  2. I will start Production deploy first - it generates production nupkg file and then I can deploy Staging
  3. I hope you can tell me another way? Maybe I can disable/skip release package checking or something else?

Thanks,
Boris

Hi Boris,

Thanks for reaching out. Instead of using 2 steps (one for each environment), use only one step and fill the fields with variables instead of hardcoded values.

For example for the field “NuGet package ID” create 2 variables like this:

Name value scope
NugetID client.project.debug staging
NugetID client.project.release production

Then on the field “NuGet package ID” in your single step, put the variable #{NuGetID}

Do the same for the rest of the fields.

Let me know how it goes!

Dalmiro

Now I got this error:

[07:58:23][Octopus Deploy] Resolving NuGet package versions...
[07:58:23][Octopus Deploy] The version number for step 'Deploy' cannot be automatically resolved because the feed or package ID is dynamic.
[07:58:23][Octopus Deploy] Using version number provided on command-line.
[07:58:23][Octopus Deploy] Release plan for release:    1.0.24
[07:58:23][Octopus Deploy] Steps: 
[07:58:23][Octopus Deploy]   #   Name     Version         Source                              
[07:58:23][Octopus Deploy]   --- -------- --------------- ------------------------------------
[07:58:23][Octopus Deploy]   1   DeployStep   ERROR           Cannot resolve  

Hey guys
I still need your help

Hi Booris,

Sorry for the delay here. I forgot to tell you to add a 3rd variable:

Name value scope
NugetID client.project.debug staging
NugetID client.project.release production
NugetID client.project.debug (No scope)

When Octopus creates the release, it still hasn’t resolved the environment-specific variables, reason why in that error message Octopus cant find any packages. By creating a 3rd variable without a scope, Octopus uses it to create the release(think of this as a placeholder), but once it starts a deployment it fetches the right package for the environment you are deploying to, following your variable-based convention.

Sorry for not telling you about that 3rd variable before. Totally my bad!

Let me know how it goes

Dalmiro

Hi Dalmiro

All works fine now. Thank you for your help.