Custom scripts in Ocotpus step vs package

Jorn's Avatar


12 Jan, 2018 01:37 PM

I have got a pre-deploy, deploy and post-deploy powershell script that I want to run. They are located in a package, but unfortunately they contain some errors. Now instead of trying to fix the errors and commit some new code, I want to test out the new versions of these scripts by enabling 'Custom deployment scripts' in the octopus step. In this step all 3 the deploy fields now have different code.

The weird thing that is happening right now, is that the pre-deploy script is used from the Octopus step, while the deploy and post-deploy are still using the versions that can be found in the package.

I assumed that enabling the custom scripts option for this Octopus step, would ignore any scripts in the package. So for the pre-deploy this seems to be the case, but not the deploy and post-deploy.

I created several new deployments in Octopus with these changes, but it is like these changes are not picked up. Any ideas?

  1. 1 Posted by Jorn on 12 Jan, 2018 02:10 PM

    Jorn's Avatar

    Going through the logs I have spotted a problem. Looks like both the Octopus step scripts are running AND the custom scripts in the package. There doesn't seem to be a sequential order to it though.

    For the pre-deploy script, the step version is executed first and than the package version.
    For the deploy script, the packages version is executed first and than the step version.

    Either way, is there a way so that it only takes the Step scripts and ignores the packages scripts?

  2. Support Staff 2 Posted by Robert Wagner on 15 Jan, 2018 03:56 AM

    Robert Wagner's Avatar

    Hi Jorn,

    Thank you for getting in touch. I'm unsure why the scripts run in that order, but it looks intentional.

    Unfortunately there is no way to ignore the packaged scripts. However it is something I intend to add this week. You can keep track of it here.


    Rob W

  3. 3 Posted by Jorn on 15 Jan, 2018 08:22 AM

    Jorn's Avatar

    Thank you for your reply. Looking forward to this option.

  4. 4 Posted by Jorn on 18 Jan, 2018 08:20 AM

    Jorn's Avatar

    Thanks for adding the variable: Octopus.Action.Package.RunScripts = false

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


? 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