The documentation implies that using
--overwrite-mode=IgnoreIfExists should make the command return success if the package already exists with the same version number. However, it does not. The option is parsed correctly – if I use an invalid option like
--overwrite-mode=fnord I get a syntax error from octo.exe – but it does not have the desired effect. Slightly cleaned example below.
PS D:\DEVOPS_AUTOMATION\Scripts\jobs> & .\octo.exe push --overwrite-mode=IgnoreIfExists --package $zipfilePath Octopus Deploy Command Line Tool, version 6.12.0 Detected automation environment: "NoneOrUnknown" Space name unspecified, process will run in the default space context Handshaking with Octopus Server: http://my-octo-server/ Handshake successful. Octopus version: 2019.5.10; API version: 3.0.0 Authenticated as: API Key - *myaccount* Pushing package: D:\DEVOPS_AUTOMATION\Scripts\jobs\packages\*redacted*.zip... Requesting signature for delta compression from the server for upload of a package with id '*redacted*' and version '8.17.438.0' Calculating delta The delta file (59 bytes) is 0.00 % the size of the orginal file (1,599,109 bytes), uploading... There was a problem with your request. - A package with the same ID and version already exists. Error from Octopus Server (HTTP 409 Conflict) Exit code: -7