neilpeterson / azure-blueprints-pipeline-tasks

MIT License
17 stars 16 forks source link

Exit build on failure #55

Closed davidshorter closed 4 years ago

davidshorter commented 4 years ago

Fail build on error (as well as write error message using ##vso)

image

ref: https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/utility/powershell?view=azure-devops#write-an-error

50

davidshorter commented 4 years ago

@neilpeterson I missed this in https://github.com/neilpeterson/azure-blueprints-pipeline-tasks/pull/51

neilpeterson commented 4 years ago

@davidshorter thanks for this.

I am wondering if the opportunity here to make the pipeline failure optional. Currently, when the assignment fails, we do throw an error, but the pipeline is successful, which is kind of accurate.

image

How would you feel about adding an extra argument on the task such as failOnAssignmentFailure with a bool value (true / false), and then act appropriately on this value?

I am currently traveling, so will not be able to dig into this immediately but happy to keep the discussion going and will get back into this ASAP.

Plork commented 4 years ago

I like it if it would fail as well. If you have stages depending on each other you would like the first stage (dev) to fail so it doesnt trigger the next (uat) for example.

neilpeterson commented 4 years ago

@davidshorter thank again for this. I may update a bit so that fail on assignment failure is optional (opt out). In any regard, thanks for driving this one.