Looking for Clarification on 'Skip any package step that is already installed'

We ran into an issue yesterday that didn’t make sense with how I understood the skip option would work. I could just be wrong with my understanding so I am looking for clarification.

The problem is this: we had an issue with our most recent release. To determine what version introduced the issue we rolled back to an older version on the target machine (one that had not been deployed to that environment yet). When we were done testing we tried to re-deploy the latest release. What we found was the older copies of packages were still installed.

We have the ‘Skip any package step that is already installed’ setting turned on and we deploy to a custom directory.

What I thought the skip step would do would be to skip packages where the last deployed version matches the one currently being deployed. It doesn’t seem to do that, but rather it seems to be skipping a package if the target machine has ever seen the package version before. Is this as intended?

Deploying package: D:\Octopus\Files\References.17.2.17191.1-rc.zip-74e7402d-0e8a-4fbe-a2e1-423a9101a1d3 July 10th 2017 17:40:32Info
Copying package contents to ‘D:\References’

Deploying package: D:\Octopus\Files\References.17.2.17184.2-rc.zip-5e687071-c18a-47c8-a873-9bbe0f9e2925 July 10th 2017 21:06:08Info
Copying package contents to ‘D:\References’

Deploying package: D:\Octopus\Files\References.17.2.17191.1-rc.zip-74e7402d-0e8a-4fbe-a2e1-423a9101a1d3 July 10th 2017 22:19:58Info
The package has already been installed on this machine, so installation will be skipped.

We are running Octopus 3.10.1.

Hi

Thanks for getting in touch! I can understand your confusion here :). From the information that you have provided their appears to be three factors in play; retention policies, application versioning and custom install directories.

On a Tentacle, Octopus will always keep the latest version of a package as well as the most current previous version. Beyond that it will remove packages and extracted packages in the default directory only as defined by your Tentacle retention polcies. However, as you are using a custom directory, the retention policy will not remove anything from that location. This can be purged during deployment in the project step settings, this will need to be configured manually. The retention policy documentation describes these processes in more detail.

The other reason that this step may not be behaving as you expect is down to application versioning. Octopus, by design, relies on the package version number to determine uniquness and doesn’t perform any checks against the package itself. So in your example if you release References.17.2.17184.2-rc, roll back to .1-rc to confirm bug introduction, perform code changes and re-release .2-rc without a version change Octopus won’t re-deploy that package as it is not considered unique. To re-trigger deployment Octopus will either need a new version number (i.e. References.17.2.17184.3-rc) or the package of the current References.17.2.17184.2-rc release will need to be removed from the Tentacle(s) cache.

I hope that answers your question, please get in touch if you any further questions!

Regards
Alex

Hi Alex, thanks for the info on retention policies. To your last point though, we didn’t change code and repackage as the same version number. We just wanted to put the latest version back on the server and didn’t expect the package to be skipped in the deployment. While the server did have that version of the package in the past it wasn’t what was most recently deployed.

Hi

Thanks for clarifying re. code deployment, I was erring on the side of too much explanation for that scenario. I also have to apologise as I missed explaining what the “Skip any package step that is already installed” option actually does. If the skip option is selected and Octopus detects the same package version is already installed on the deployment target, all features of a package step will be skipped. By default, Octopus will always re-deploy every included package.

In your scenario this feature is working as designed as it’s not checking against just the latest deployment, it is referencing if any deployment for that package has occurred on that Tentacle. Also, as this is not a saved setting in a release or deployment you can turn this option off, re-deploy then re-enable this feature if it is performing the function that you require.

Any further questions please let me know!

Regards

Alex