In Octopus Deploy there is the concept of lifecycles. They look something like the following -
It allows you to say things like "Environments from Dev must be completed before deploying to Staging".
In Azure Devops you can achieve this if you use an "After Stage" trigger. However this makes the deployment to the next stage automatic. You can set either post-1st stage or pre-2nd stage approvals to stop this but if these are "rejected" then it looks like a failure when it isn't necessarily so - quite often we just don't want to deploy to these environments.
Another workaround is to use the REST API in a gate on a manually triggered stage as shown in this question but this doesn't feel right - it throws off the "deployment graph" which may seem trivial but it doesn't allow someone coming in from the outside to see what's really going on. Also it doesn't stop anybody trying to manually trigger this at any time.
Is there a way to achieve this?
I am afraid that there is no better way at the moment. Even if you use workaround with rest api in the gate, if you don't pass the gate, the resulting stage state is the same as "rejected".

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With