Detecting cancellation in Azure Pipelines #3616
-
When building Unity, there's code I need to execute to return the license no matter what happens. I'm using Frosting. Now, I want to make sure that the code executes when the build is cancelled on Azure Pipeline. I'm trying to figure out when/how the various Teardowns occur. I had the code in the "Finally" of the Frosting Task, but that didn't work. However, I'm having a very difficult time testing this out. Does anyone know what Azure Pipelines sends when the build is cancelled, and whether or not Cake goes through the Task/Context teardowns when that happens? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
You can use the Cake.AzureDevOps addin which provides aliases to retrieve information about an Azure Pipelines build, including the status and result: https://cakebuild.net/api/Cake.AzureDevOps.Pipelines/AzureDevOpsBuild/ |
Beta Was this translation helpful? Give feedback.
-
Depending on what exactly you want to do, an option could be to add a second step to the Azure Pipeline with a condition of |
Beta Was this translation helpful? Give feedback.
Depending on what exactly you want to do, an option could be to add a second step to the Azure Pipeline with a condition of
always()
, so that it is also called when pipeline is canceled and in this step you can call a specific target of the Cake build