Question

I have set up a build step on TeamCity,as described here, to do automatic release deployments to our test server. But it is not using the latest nuget packages that was build in TeamCity.

Use Case :

Teamcity will create nuget package with version 1.0.0.9, all the dlls that is in the package is the correct version, and the Release in Octopus, that was deployed has got the same version number , but the packages that octopus uses is of an earlier package eg 1.0.0.5.

I have specified the --force parameter on the build step so it should use the latest packages but it is not.

If I manually create a release in Octopus, and select the latest packages it is working 100%

Please can someone tell me if I am missing something.

thanks in advance

Was it helpful?

Solution

I think what you need to do is create two build configurations in TeamCity, one to build and one to deploy with Octopus. Refer to this link that has a small blurb toward the end:

Note that NuGet packages created from your build won't appear in TeamCity until after the build completes. This means you'll usually need to configure a secondary build configuration, and use a snapshot dependency and build trigger in TeamCity to run the deployment build configuration after the first build configuration completes.

So in my case I created 2 build configurations, then setup a snapshot dependency from the build to the deploy config and also a trigger to kick off the deploy after a successful build.

OTHER TIPS

It looks like --force is just to force packages to the be re-installed if they have already been installed. Are you using the --packageversion parameter?

My organization uses Jenkins CI. We use the unique build number as our package version and then deploy that specific package version using the --packageversion paramater.

In the case where we have multiple services that need to be deployed. We have an upstream job / main job that provides the unique build number.

I'd imagine you can do the same thing with TeamCity

Master Job (unique build number) calls jobs A and jobs B with parameter (unique build). Jobs A and B build version (from Master Job). Jobs A and B complete then publish their respective versions.

It could be a few things.

Check out.

http://octopusdeploy.com/documentation/integration/teamcity

You haven't mentioned how your consuming the feeds from Octopus in Teamcity. I would start there.

Next I would use the teamcity action to do your deploy. You asked "Where should the --waitfordeployment flag be added" there is a check box to make sure the deploy has worked before the action can continue.

In TeamCity I use a Octo Push Packages step and in the Additional Parameters field I specify the --defaultpackgeversion {VERSION} parameter.

This will force Octo to use a specific version of packages instead of just choosing the 'Latest Version'.

There are more possible reasons for the problem.

  1. To see the problems with Octopus go to Configuration -> Diagnostics enter image description here

  2. Another common problem is to use a Package Name #{variable} in a deploy step

    Currently it is not possible and Package Name should be set manually, for example MyWebSite or MyWindowsService. See UserVoice for this feature. enter image description here

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top