Octopus deployment from Teamcity not using the latest packages

冷暖自知 提交于 2019-12-03 08:32:06

问题


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


回答1:


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.




回答2:


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?




回答3:


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.




回答4:


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.




回答5:


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'.




回答6:


There are more possible reasons for the problem.

  1. To see the problems with Octopus go to Configuration -> Diagnostics

  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.



来源:https://stackoverflow.com/questions/17107988/octopus-deployment-from-teamcity-not-using-the-latest-packages

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!