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

Webhook from AWS Codebuild to Bitbucket

Eunbi LEE March 24, 2023

As the title, I want to receive the results from AWS CodeBuild to Bitbucket Pipeline,

For example, I want to know some results of CodeBuild (success, failure) at Bitbucket 

Is there a way to do that?

1 answer

1 accepted

2 votes
Answer accepted
Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 28, 2023

Hello @Eunbi LEE ,

Thank you for reaching out to the Community!

My understanding is that you use AWSCodeBuild to build your code hosted in Bitbucket Cloud, and you would like the build status on AWS to be reported back into Bitbucket. If that is the case, AWS has the below article with steps on how to build that integration : 

This should allow you to have the AWS build status posted back to Bitbucket Cloud

Thank you, @Eunbi LEE !
Patrik S

Eunbi LEE April 3, 2023

Thank you for answer,

 

And yes, I already read this article but furthermore, I want to send build status of AWS Codebuild not CodePipeline to Bitbucket,

Is there a way with REST API ?

 

Thank you @Patrik S 

Eunbi LEE

Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 4, 2023

Hello @Eunbi LEE ,

To create/update the build status for a commit, you can use the following Bitbucket API endpoints : 

curl -X POST -u username:app_password https://api.bitbucket.org/2.0/repositories/my-workspace/my-repo/commit/e10dae226959c2194f2b07b077c07762d93821cf/statuses/build/ -H 'Content-Type: application/json' -d '{ "key": "MY-BUILD", "state": "SUCCESSFUL", "description": "42 tests passed", "url": "https://www.example.org/my-build-result" }'

The valid values for state are FAILED, SUCCESSFUL, INPROGRESS, STOPPED.

curl -X PUT -u username:app_password https://api.bitbucket.org/2.0/repositories/my-workspace/my-repo/commit/e10dae226959c2194f2b07b077c07762d93821cf/statuses/build/{key} -H 'Content-Type: application/json' -d '{"state": "FAILED", "description": "10 tests failed", "url": "https://www.example.org/my-build-result" }'

You can find more details about the build status endpoints in our API reference documentation : 

Thank you, @Eunbi LEE !

Patrik S

Eunbi LEE April 20, 2023

It works :) Thank you so much ! @Patrik S 

Like Patrik S likes this
Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 20, 2023

You're very welcome!

Feel free to reach out to Community again if you ever need help in the future :) 

Like Eunbi LEE likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events