The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

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!

TAGS
AUG Leaders

Atlassian Community Events