Hi,
Is there any way to prevent octopus from deleting an extracted package on step failure in guided failure mode? Often times there may be log files or staging files in that extracted package folder that I need to see to determine why the step failed and how to recover from it. It would be fine to delete the extracted package once a retry is executed or the step is ignored but in guided failure mode it would be nice to leave it alone until an action is decided upon.
Unfortunately, I don’t believe that it is possible not to have Octopus clean up that working directory after the step has been completed. However, you can retrieve the package before it was extracted on the target in the Files directory. You’d then be able to extract it yourself and view the contents.
One of my colleagues shared that we do have a way to copy the working directory before it gets deleted, enabling you to inspect it during a guided failure.
You can create a project variable named Octopus.Calamari.CopyWorkingDirectoryIncludingKeyTo with the value set to the directory on the target that you would like the contents to be saved to. The directory you save the contents to you can then inspect. You will need to manually clean up this directory after debugging.
This has exactly the behaviour that I want. The custom installation directory is only ever cleaned when the script is executed, or retried. As well I could put in a filter that keeps the log folder from being cleaned.
The only downside that I can see is that I will have to cleanup these directories periodically myself or write that into my scripts.