Ability to automatically remove files/folders no longer in build from deployment target

justin.baker's Avatar

justin.baker

10 Jan, 2017 07:04 PM

Is there a way to have Octopus automatically remove any files/folders that no longer exist in a package from the deployment target? I know you can purge the directory first, but this is not the option we want to use. Instead, say a folder named "Test" with some files under it is currently deployed, but a newer build removes that, we would like to have it also removed from the target when the deployment happens. I'm sure there has to be a way to do this and I hope the collective wisdom here can point me in the right direction.

Thanks.

  1. Support Staff 1 Posted by Daniel Fischer on 11 Jan, 2017 08:20 AM

    Daniel Fischer's Avatar

    Hi Justin,

    Thanks for getting in touch! Unfortunately, there is no way in Octopus to do what you are after here. This is one of our thought processes behind not making Custom Installation Directory a default enabled feature. The default method that Octopus uses to manage its directories covers this by creating a new directory for every deployment. This also enables you to redeploy a previous version quickly if there is an issue with the newest release.

    The only ideas that come to mind are as follows. The first being to purge the directory, but as you say that’s not an option. I believe creating a custom post-deploy script would be the only way that you could manage this.

    Sorry for the bad news.

    Best regards,
    Daniel

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac