Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Trigger bitbucket pipeline manual step using API

Hi

 

As part of my Bitbucket Pipeline, I want to invoke a long running asynchronous process (external to BitBucket).  Once complete, if successful, it would promote the build

 

My pipeline:

 

pipelines: 
default:
-
step:
name: Deploy to test
script:
- yarn install
-
yarn run deploy:test
-
yarn run deploy:verify # triggers asynchronous process
-
step:
name: Verify Deploy
trigger: manual
script:
-
yarn run deploy:post-verify
-
step:
name: Deploy to prod
script:
- yarn install
-
yarn run deploy:prod

 

Can I trigger the `Verify Deploy` stage from code?

4 answers

PUSH, also need this!!!

I've gotten this to work using the Bitbucket API.  The API call used was:

curl -X POST -is -u '$USERNAME:$PASSWORD' \
-H 'Content-Type: application/json' \
https://api.bitbucket.org/2.0/repositories/$USERNAME/$REPONAME/pipelines/ \
-d '{
"target": {
"selector": {
"type": "custom",
"pattern": "hello"
},
"type": "pipeline_ref_target",
"ref_name": "master",
"ref_type": "branch"
}
}'

The bitbucket-pipelines.yml file was:


pipelines:
custom:
hello:
-
step:
script:
-
echo "Hello world!"

Hi Andrew,

What are the values for the $USERNAME:$PASSWORD ?

Where can I get them ?

 

Thanks

This is over one year old, any update atlassian

There's an outstanding request for this feature here: https://jira.atlassian.com/browse/BCLOUD-20050

 

Please add your +1 (via More > Add vote).

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket

Powering DevOps with Bitbucket Server & Data Center

Hi everyone, The Cloud team recently announced 12 new DevOps features that help developers ship better code, faster   ! While we’re all excited about the new improvements to Bitbucket ...

1,869 views 0 7
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you