Aws codepipeline report pipeline status to bitbucket

matheus silva
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 11, 2024

I have pipeline for branches, defined as per: https://gist.github.com/matheus1lva/e3830702351c85ac5c5db8acb4a98c0b

 

I was expecting that the codestarconnnection would retrieve status back to bitbucket on the pipeline itself, but it didn't. Is there a way to achieve this?

1 answer

0 votes
Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 12, 2024

Hello @matheus silva ,

and welcome to the Community!

Essentially, when you run a build in an external tool, such as AWS CodePipeline, the tool needs to report the build status to Bitbucket using the Bitbucket APIs to Create a build status for a commit or  Update a build status for a commit, which will make the Bitbucket UI reflect the latest status of the build and link it to the provided commit.

If the CI/CD tool you're using does not implement that natively, you'll need to manually make a request to that API endpoints as part of your build:

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

I hope that helps! Let us know in case you have any questions.

Thank you, @matheus silva !

Patrik S

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events