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?
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.