In his second week of work experience at endjin, Jack, 15, writes a console application to display TeamCity build statuses using a BusyLight.
Today we had a very productive day. Richard and I created a console application where we were able to retrieve the success or failure of a TeamCity build, and make a Busylight change colour to show the status. TeamCity is a ‘continuous integration platform’ which lets you manage all your code in one place. When someone publishes changes to some code, TeamCity tries to build and test the code to make sure it’s all still working.
As with our previous project which made the Busylight change colour, we included the Busylight SDK in the project. We also included the TeamCitySharp library, which is a free package for accessing TeamCity via their REST API.
We checked for build success, failure or an error by providing the build configuration ID from the TeamCity website and getting back information about the build using TeamCitySharp’s Build and BuildStatus types.
We made it so a failed build made the light flash red and pink with a period of just pink. Whereas a solid green light indicated that the TeamCity build had succeeded without any problems. We also made it so if there was an error it would turn solid pink.
We made a field for users to enter their TeamCity account and details.
After this we made it so that the when you put in your details the password would show as asterisks to protect your security.
We also made sure that Richard’s details were not still in the code when we uploaded it to GitHub to protect his security.
Finally we “resharped” (Note from editor, this means used ReSharper but I quite like this version!) a number of areas so the code looked neater, and I learnt to refactor the code out into classes.
It was great to see when it worked!
You can find the application on GitHub.