{
  "$type": "site.standard.document",
  "path": "/updating-github-status-from-bamboo/",
  "publishedAt": "2015-11-14T16:15:34.000Z",
  "site": "at://did:plc:6gssgguzeecdttuw4gpdshg2/site.standard.publication/self",
  "tags": [
    "github",
    "bamboo"
  ],
  "textContent": "GitHub has a great Statuses API. This gives you a great way to update the information from your automated build process. Giving you a quick overview of the status of a branch.\n\nAt Dotsub we use Bamboo to build our applications. Bamboo does not have a native GitHub integration so we had to create our own.\n\nWe wanted to ensure that our unit tests, findbugs report and checkstyle reports were reflected in the GitHub branch status.\n\n[Image: Screen-Shot-2015-11-14-at-11-09-57-AM.png]\n\nThis is pretty simple to set up. We'll use two small scripts and cURL. First let's add a Script task at the start of our build. This will update the branch status so we know it's building.\n\nAdd this task at the very start of the build. [Image: Screen-Shot-2015-11-14-at-10-49-51-AM.png]\n\nThe script looks like this:\n\n[Embedded code (GitHub Gist)]\n\nThis updates GitHub and shows that branches status as 'building'.\n\n[Image: Screen-Shot-2015-11-14-at-10-58-56-AM.png]\n\nNow all we have to do is update the build at the end as well. We will use grep to count the errors in the reports. This was we can include this on the branch details.\n\n[Embedded code (GitHub Gist)]\n\nThis updates GitHub will the status and the number of each type of error. You instantly know the status/mergeability of any branch in your repository. [Image: Screen-Shot-2015-11-14-at-8-50-19-AM.png]\n\nThere you have it. A quick and simple way to set up Bamboo to update GitHub with build statuses. Your team will always know the status of every branch in your repo.\n\nRead the original post with all embeds and interactive content at https://rants.broonix.ca/updating-github-status-from-bamboo/",
  "title": "Updating GitHub Status from Bamboo"
}