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?
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.
web-server
are also scoped to web-server-autodeploy
web-server-autodeploy
web-server
and web-server-autodeploy
machinesweb-server-autodeploy
roleIf 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