Using Amazon AWS, Jenkins, and Sonar for university projects

Posted on · 1 minute read

If you study information technology at the technical university in vienna, sooner or later there comes the day when you have to work on a project together with some other people. One course, namely software engineering and project management, is specifically designed to teach students about the joys (or horrors) of developing software in a team.
You are supposed to create reasonably complex software using Java together with Maven, JavaFX and so forth. Since I really like working software - yeah, sure, who doesnt - I decided to facilitate teamwork by providing some tools that I have used in the past. Sonar and Jenkins.
Jenkins is one of the most popular buildservers, and it is fairly easy to host. Sonar provides code analysis and metrics, allowing the team to produce high-quality code. In order to host those tools I first thought about using Azure, but since Amazon provides a free EC2-Micro instance in the first year, I switched camps. Sorry Microsoft. Initially, I installed both Sonar and Jenkins on the same instance, but as it turns out, sonar needs quite a bit of memory, so that doesnt really work.

AWS

  • Two EC2 Instances
  • Micro instance, running Jenkins and the Sonar runner
  • Small instances, running Sonar. This used to be a micro-instance, but the server crashed if an analysis occured so I had to upgrade.
  • Two elastic IPs, so each server is seperatly reachable.

Jenkins

  • Build on changes of development branch
  • Do a maven build including reports, for test coverage
  • Execute sonar runner and push result to the sonar server
  • Publish build results to slack channel

Jenkins Setup

Sonar qube

  • Modified quality gates, espacially regarding test coverage
  • User accounts for the team

Sonar Setup

Using this, we get to enjoy supreme reliability and quality. Especially the integration with Slack has made it super easy to keep track of any changes. It took some time to get the setup right, but it was worth it.