Wednesday, September 16, 2015

DevOps and PowerShell : Automating SonarQube installation - part 1

SonarQube is an open platform to manage code quality. It has
been developed with a main objective in mind: make code quality management
accessible to everyone with minimal effort. Since version 2.0 SonarQube convers
the 7 axes of code quality

Architecture and Design

Comments

Duplications

Coding rules

Unit tests

Potential bugs

Complexity

SonarQube embarks a plugin architecture that makes it easy
to add rules and matrices by the community and hence contribute to the
development. At current state it covers more than 20 programming languages
which includes all the popular programming languages currently used for
application development. You can find more information on the project and
plugins at the SonarQube website.

I was trying to setup a local SonarQube repository on my
development machine to test some plugins and features and was looking into the
documentation for installing and configuring SonarQube. This involved a series
of manual steps to download, install and configure multiple softwares and
services and was not fun at all. Well as a big PowerShell and automation fan, I
decided to automate the entire process. The following is the summary of my
attempt to automate SonarQube installation!!!

Setting up the prerequisites:

SonarQube has the following requirements.

Java runtime (JRE 7 or above)

Database – SQL server in my case with language set to English, Collation to
CS and AS.

I created 2 functions to check JRE installed on my machine
and install if not present.