Force deployment not working

We’re using octo.exe to create a release and deploy to our staging envirionment, using the following command:

octo.exe create-release --project=MyProj --releaseNumber=1.2.3.4 --packageversion=1.2.3.4 --deployto=Staging --server=http://octo/ --apiKey=apikeyhere --waitfordeployment --force --ignoreexisting

This works when you first deploy with the one release number. If we later want to force a redeployment of the same release, this doesn’t work - the --ignoreexisting arg means it doesn’t fail due to a version conflict, but it also doesn’t redeploy the same package to staging, despite the --force arg.

I thought this is what the --force arg was meant for? If not, how do we do this?

Thanks.

Hi Marcus,

Thanks for getting in touch. This appears to be a bug in the Octo.exe logic. If the release already exists, the --ignoreexisting argument keeps going, but it doesnt deploy the release to the environment set by --deployto. I’ve submitted a github issue to get this resolved: https://github.com/OctopusDeploy/Issues/issues/1847

In the meantime, you can workaround this by calling Octo.exe 2 times:

  1. Use Octo.exe Create-Release only with the arguments --Project,--ReleaseNumber,--Server,--APIKey,--IgnoreExisting,--packageversion and --progress. This way you’ll only use this first call to create the release, and if it exists then nothing will happen. No deployments will be triggered up to this point.

  2. On the 2nd call use Octo.exe deploy-release with the parameters --Project,--ReleaseNumber,--Server,--APIKey, --deployto and --progress to deploy the release (which at this point should already exist)

RE your question about --force, this parameter tells the deployment to download the package to the tentacle, even if it was already on the machine.

Hope that helps!

Dalmiro

​​
Perfect, this does what I need. Thanks!