Forums

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

Post build status to Bitbucket Cloud from External Build Server

Bharath Sankaran March 10, 2020

Hi,
I am running my build and tests on AWS Codebuild which is triggered on a push to a particular branch in Bitbucket Cloud. I would like the build result to post back to that commit in Bitbucket, but I cannot figure out what API to use to post that build result back from AWS Codebuild.

I could find a similar integration in Jenkins 
https://plugins.jenkins.io/publish-to-bitbucket/

and API for Bitbucket Server but nothing for Bitbucket Cloud. Can someone point me in the right direction or show me how I can do this?

1 answer

1 accepted

1 vote
Answer accepted
Daniil Penkin
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 10, 2020

Hello @Bharath Sankaran,

Here's an endpoint to post a build status against a commit.

Something like this:

curl -X POST -is -u <username>:<password> \
-H 'Content-Type: application/json' \
https://api.bitbucket.org/2.0/repositories/<workspace>/<repository>/commit/<hash>/statuses/build \
-d '{
"state": "SUCCESSFUL",
"name": "Build name",
"url": "https://url-to-your-build",
"description": "Build description"
}'

Hope this helps.

Cheers,
Daniil

Bharath Sankaran March 11, 2020

Thanks a ton!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events