Now that bitbucket has added native support for build statues, you may want to consider using codeship-bitbucket-buildstatus written by App Haus. This solution is similar to mine, but it utilizes the bitbucket build status API for a better integration.
Small app that will automatically update newly created pull requests in Bitbucket with the branch's Codeship build status.
First just deploy a free instance of the app on heroku using the button then just follow the steps below.
- Create an API Key in Bitbucket for your team and use your team name as the
username
and the API Key as yourpassword
in the next step. - Set
BITBUCKET_USERNAME
andBITBUCKET_PASSWORD
ENV variables to match with theusername
andpassword
above. - Add a
Pull Request POST
hook in Bitbucket forCreate / Edit / Merge / Decline
that points to your instance of this app. The URL should look something like this:https://<BITBUCKET_USERNAME>:<BITBUCKET_PASSWORD>@<YOUR_APP_NAME_ON_HEROKU>.herokuapp.com/pull-request/<CODESHIP_PROJECT_UUID>/<CODESHIP_PROJECT_ID>
- Which would look something like this:
https://username:[email protected]/pull-request/ee1399cc-b740-43da-812f-d17901f9efa7/52132
- Now whenever a pull request is created, it should (almost instantly) get updated to have the Codeship Status Badge in the description.
Server runs on port 8000
by default, but will use the port set
on the environment variable PORT
if set.
- Run
npm install
for the initial setup. - Set
BITBUCKET_USERNAME
andBITBUCKET_PASSWORD
ENV variables. - Run
npm start
to start the server.
To execute all the tests, just run:
npm test
To run all tests and watch for changes to re-run tests:
npm run watch