File Logging on Deployments

Is there a verbose setting that allows all file deletes/creates to be logged on a deployment. For example you are deploying a website to C:\inetpub\wwwroot\XXX and select the Purge option.

Can you get a log of the files deleted?
Can you get a log of the files transferred to C:\inetpub\wwwroot\XXX?

Hi Chris,

Thanks for getting in touch.

Files deleted - You cannot get a log of them when using the Purge option. What you can do though is add a pre-deploy script to your deployment process that deletes the files with the verbose switch. The script should look like this:

remove-item $OctopusParameters['Octopus.Action[DeployStepName(change this value)].Package.CustomInstallationDirectory'] -verbose -recurse

Please remember to change the step name on the Octopus variable accordingly. Also remember to switch off the purge checkbox, just in case.

Files transfered - Again, you cannot get this by default, but you could list the directory files on the custom installation dir after the deployment with the following script on the post-deploy field:

remove-item $OctopusParameters['Octopus.Action[DeployStepName(change this value)] -verbose -recurse

Hope it helps!


Thanks. Should be sufficient.

But, I didn’t understand the last post-deploy script you listed…

So I went with this in the post-deploy:

Get-ChildItem $OctopusParameters['Octopus.Action[DeployStepName(change this value)].Package.CustomInstallationDirectory'] -recurse | Sort-Object lastwritetime -descending