6
votes

I have 3 steps YAML pipeline Build (1), Deploy To Development (2) and Deploy to Test (3).

My needs are very basic:

  • a. When some code changes in master, pipelines triggers (OK)
  • b. With this changes, Build and Deploy To Development stages automatically runs (OK)
  • c. Deploy to Test stages waits until I approve (OK)

But I've facing a problem if I don't approve the Stage (3), the pipeline never ends and always shows an in-progress icon. So whenever I check the Pipelines page, I saw all pipelines are running but actually is not.

Worse part is the whole pipeline falls in Failed status after two weeks.

My question is:

Is there any way to mark Deploy to Test stage as optional? The pipeline should be completed without this stage but optionally I want to able to execute this step manually.


Azure DevOps - Multi Stage Pipelines Summary

1
By the way originally I've created an issue on GitHub. But it seems no one from Microsoft answering these questions. Issue link: github.com/microsoft/azure-pipelines-yaml/issues/344Mustafa S.
I think is not possible, MS should improve the multi stage. Open also a question here: developercommunity.visualstudio.com/spaces/21/index.htmlShayki Abramczyk

1 Answers

3
votes

For your issue, I think it is currently not supported in multi-stage yaml.

If you want to run a stage manually in yaml, you can only through creating checks for your environments. There are only two options for review: Approve or Reject. So when you don't want to deploy to this stage, the stage will remain in the waiting state, and will automatically reject until the approval timeout. Once deployed to the stage is rejected, the pipeline will show as failed, even if the previous stages were successfully deployed.

So just as Shayki said in the comment, the multi-stage needs to be improved, it should give the stage a more reasonable manual trigger. Here I created a feature request for your issue in our developercommunity forum. You can vote and comment here to improve its priority.

In addition,as a workaround ,you can deploy with release pipeline. You can create Release pipeline in Releases Page. Then you can add test stage and set Manual only trigger for it. So that the pipeline can be completed without this stage .

enter image description here