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?
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
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.