Home‎ > ‎Maven‎ > ‎Build Server‎ > ‎Team City‎ > ‎

Github Pull Notification App

This is about a command application I built to monitor GitHub projects for new pulls and notify GitHub about the build server progress for the pull. 

Reference

Hows it Work

This application can set the GitHub repository commit status to 4 different statuses. Error, Failed, Pending and Success. So when a pull is made the Team City build server can set the pull status in GitHub.
  • Error:
  • Failed:
  • Pending:
  • Success: 
    • This also adds a commit message which notifies the project pull collaborators.

Application Install

The application is still new so I've only built a war configuration as of yet. Down the road, I'll deliver other binaries. This application can be used via the command line or in team city command line build step. 

1. Download source and build war. (TODO: more binaries coming in the future) 
2. Install war in servlet container. I like to use the Tomcat Manager for deploying the application.

Team City Use

1. Goto the project by clicking on 'Edit Project Settings' in teamcity.
2. Select Create Build Configuration and name it something like 'Monitor Pulls'.
3. On the Version Control Settings setup, setup the VCS normally but change the 'Branch Specifications'.
  • Add to 'Branch Specifications': refs/pull/*/head
4. Add command line build step to project build and name it something like 'Pull Notification Pending'. 
5. Set the working director to the path of the library and it might be like :
  • /var/lib/tomcat7/webapps_teamcity/github-tools/WEB-INF/ - working directory path
6. Set run to script and add the pending template:
7. Change the template parameters to match the configuration.
8. It will look something like this. 
9. Add a build step that will check the status at the end. Name it something like 'Pull Notification Update'.
10. Be sure that the update step 'Execute step:' is 'Always, even if build stop command is issued'.

11. The order should look something like this at the end.







































Comments