Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How do I cancel/abort a pipeline which has a manually-triggered step?

Robert Williams January 23, 2020

My current use-case is the following:

pipelines:
branches:
master:
- step:
name: Generate changeset
script:
- something which generates a changeset
- step:
name: Apply changeset if approved
trigger: manual
script:
- something which applies the changeset

This works fine, but in the cases where the changeset is not approved, and the changeset should not be applied, how best can I throw the rest of the execution away rather than leaving the pipeline execution forever hanging around waiting for the go-ahead, potentially running the risk of some other overzealous person kicking the changeset application off?

Ideally I would be able to view the output of the first step, and then conditionally either run or abort the rest of the pipeline.

Is there anything that provides this kind of functionality already that I'm missing?

Parallel manual steps are not supported, so I can't implement a branching decision structure in that manner, similarly you can't supply a "yes/no" value at runtime via either configuring a `variables:` section for the pipeline step, or by trying to `read ` a user-provided value (on which to drive the branching logic) as part of the manually-executed step.

1 answer

0 votes
mkleint
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 2, 2020

there is an API call to stop a pipeline - https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Bworkspace%7D/%7Brepo_slug%7D/pipelines/%7Bpipeline_uuid%7D/stopPipeline 

but I think it's not what you are looking for.

 

The best way to protect against unintentional execution of the manual step is to include some checks right into the manual step and validate the preconditions like approval of the changeset and fail the step if these conditions are not met.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events