Force Re-Deploy without having to check the Force Redeploy checkbox

I’m using Octopus Deploy to deploy a website containing a ClickOnce deployer inside it as well as some webservices etc. Anyhow, I have TeamCity build a single nuget package, and then when I deploy the package to the server I do a whole bunch of things like signing the clickonce application, copy the website contents to where I want it, set authentication, etc.

Anyhow, we have multiple configurations (based on company division) that can be deployed from that one nuget package. When I deploy these different configurations the first one succeeds, while subsequent ones fail because Octopus detects the package already on the server. So in order to deploy these other configurations, I have to click 'Force Redeploy". I don’t want to do that, is there somewhere I can configure this so I don’t have to.

Hi,

The simplest way to do this is to create a variable in your project called OctopusForcePackageRedeployment set to true. This has the same effect as checking that checkbox, only you won’t have to remember to do it every deployment.

Another option would be to “re-package” the NuGet package, so that each configuration gets a unique package ID or version. NuGet version numbers can contain strings, so you could use:

  • MyPackage.1.0.0-foo
  • MyPackage.1.0.0-bar
  • MyPackage.1.0.0-baz

Hope that helps,

Paul

This page has more information about that variable:

Paul

Yeah I wanted to avoid making multiple packages because each one is so large… (The clickonce installer is 250mb) and as always, disk space seems to be a difficult thing to procure.

I did notice that variable, but the way the documentation is written it wasn’t clear to me that it would have the same affect as clicking the check box. Thanks for clearing that up.

Thanks for your help. And thanks for making this product, I’ve been telling everyone I know about it, its really great, and your integration with TeamCity is awesome!

Keith.