One could update the build status in bitbucket as follows:
Adding a build result to a commit
To associate a build result with a particular commit, you need to POST
a JSON object to the build status REST resource at:
https://<bitbucket-base-url>/rest/build-status/1.0/commits/<commit-hash>
The format of the JSON object that should be used as the request body
is:
{
"state": "<INPROGRESS|SUCCESSFUL|FAILED>",
"key": "<build-key>",
"name": "<build-name>",
"url": "<build-url>",
"description": "<build-description>"
}
One could run such a snippet by codefresh at the end of the build using a script to notify bitbucket regarding the build status of a commit.
One green build
The following curl command will add a build to the commit
9e72f04322c4a1f240e0b3158c67c3c19cdd16e7:
curl -u username:password -H "Content-Type: application/json" -X POST
http://localhost:7990/bitbucket/rest/build-status/1.0/commits/9e72f04322c4a1f240e0b3158c67c3c19cdd16e7
-d @build0.json
Where build0.json contains:
{
"state": "SUCCESSFUL",
"key": "REPO-MASTER",
"name": "REPO-MASTER-42",
"url": "https://bamboo.example.com/browse/REPO-MASTER-42",
"description": "Changes by John Doe"
}