Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mark pipeline status 'Completed' with optional stages

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

like image 355
Mustafa Sadedil Avatar asked Oct 19 '19 08:10

Mustafa Sadedil


People also ask

What are 3 important stages in a pipeline job?

You can organize the deployment jobs in your release pipeline into stages. Stages are the major divisions in your release pipeline: "run functional tests", "deploy to pre-production", and "deploy to production" are good examples of release stages.

What runs a job in a pipeline?

Agent pool jobs run on an agent in the agent pool. These jobs are available in build and release pipelines. Server jobs run on TFS. These jobs are available in build and release pipelines.

What is the difference between build and release pipeline?

A Build Pipeline is used to generate Artifacts out of Source Code. A Release Pipeline consumes the Artifacts and conducts follow-up actions within a multi-staging system. It is best practice to establish a link between a Build Pipeline and the corresponding Release Pipeline.


1 Answers

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

like image 143
Hugh Lin Avatar answered Oct 25 '22 22:10

Hugh Lin