Script Execution With Multiple Deployment Targets

First time setting up a project with octopus deploy and I’ve built a console app and packaged it with Octopack that will update my production databases when moving from QA->Beta or Production with any relevant data or table changes.

My question is built-in powershell script module seems to indicate it will run it on every deployment target.

Is there a way to specify ‘run only once’? I could specify a specific system, but then my whole deployment process is locked down by 1 system being up rather then it working if any system is alive.

I was thinking ‘Run on: Octopus Server’ might be this option. However, the text ‘This step will be run on the Octopus Server on behalf of all deployment targets in parallel’ has me worried since running 1 operation … wouldn’t be ‘in parallel’.

Hi Chase,

Thanks for getting in touch! While you can run your script only once by scoping the step to a unique role on one machine, you’re correct in pointing out that it would require your machine to be up in order for it to work.

There’s no explicit setting to choose for ‘run only once’ in your script step settings, but you can achieve the same result by selecting no roles while running it on the Octopus Server (shown in my attached screenshot). This will run the script only once, and won’t require any specific machine to constantly be up.

I hope this helps. Let me know how you go, and if you have any further questions!

Best regards,

Kenny