Auto deploy step filter

Is there a way to disable a step from running if triggered automatically via a trigger?

If not, is there a way to identify this within a powershell script?

Hi,

Thanks for getting in touch.

Project Triggers (aka. auto-deploy triggers) were really designed to re-queue the same deployment process that was previously successful. However, you could potentially solve this using machine roles…

It’s a bit of a workaround, but assuming you currently have, for example, steps scoped to a web-server role. You could make a new machine-role web-server-autodeploy, and assign that role to steps that you only want to run during an auto-deploy. Then you could scope your project trigger to that web-server-autodeploy role and then auto-deploy will only run steps relevant to that role.

For this to work though, the machines that you are bringing online must only have the web-server-autodeploy role assigned. So you end up with some role duplication … one role + an auto-deploy version of that role.

Eg.

  • Modify your deployment process so that all steps scoped to web-server are also scoped to web-server-autodeploy
  • Modify your project trigger to be scoped to a single role: web-server-autodeploy
  • Run your initial deployment, which will run against any machines you have scoped to web-server and web-server-autodeploy machines
  • Any new machines you bring online, ensure they only have the web-server-autodeploy role

If that doesn’t quite solve your problem, you could consider adding a uservoice suggestiondetailing your situation. If your suggestion gets enough community support/votes, we will consider adding it as a feature in a future version of Octopus.

There is a current uservoice here that has asked about adding a QueuedBy system variable to help determine if a deployment has come from an auto-deploy (project trigger) vs a manual deployment (from a user). That may be worth voting for if you think it could help in your situation.

Hope this helps.

Cheers
Mark