Octopack build in release and debug mode

With our current deployment flow we’re having two TeamCity configurations for building or development branch in release and debug mode. The debug build of the development branch is then deployed to our development environment and the release build is deployed to the staging environment. What is the recommend way to handle this scenario with octopacks? The main difference is that we’re are fetching artifacts from TeamCity from it’s build target and with OctoPack we’ll need to build nugets that are unaware of the target. Should be give the debug build a new nuget-id that differs from the release build? I think we’ll have the same problem for release builds from development/release branch as well?

Hi Örjan,

I’d have TeamCity perform two builds that produce two different NuGet packages:

  • YourApp.1.0.0-Debug.nupkg
  • YourApp.1.0.0-Release.nupkg

You can do this by specifing the MSBuild parameter OctoPackPackageVersion. An example might be:

/p:OctoPackPackageVersion=1.0.%build.number%-Debug

Now that you have two builds, you can configure your project in Octopus to have two steps - one for the -Debug package that only deploys to Development, and the other for the -Release package that deploys to the other environments.

When you create a release, you’ll then be asked to specify the version of both the debug and the release package.

I hope this helps,

Paul

Thanks for a quick reply adding the build number to the patch field will work for us and using the pre-release for debug/release is great.

Even if it would be great if nuget had support for YourApp.1.0.0-Debug.1337

Hello,
We have a similar problem but we are using TFS 2012.
We are using tfsversioning template to generate the version number. https://tfsversioning.codeplex.com/documentation.
OctoPack seems to work nicely with this.

But since we are using tfsversioning I cannot use OctoPackPackageVersion argument for msbuild.

Is there another way I can generate different package for release vs debug configuration.
Thanks,
Vinay

Hi Vinay,

Thanks for getting in touch! We are in the process of merging a Pull Request that we think will help you in this situation.


It should allow you to create the package name that you require.

Vanessa