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:
The format of the JSON object that ...