Sonarqube is a self-managed, automatic code review tool that systematically helps you deliver clean code. SonarQube integrates into your existing workflow and detects issues in your code to help you perform continuous code inspections of your projects. In this article we will examine how to integrate it with Teamcity in order to scan our workflows during build.
First you will need to install the sonar runner for your teamcity installation. You should go in the administration tab
and then plugins
Then browse plugin directory and install the sonar runner.
After that you should go in root project and integrate sonar tool with teamcity.
Press add a new server and provide Name, URL and the Token. Token can be retrieved from your sonar installation. Under Administration select security and create a new token with an expiry date.
Finally you can create a new build definition and use the sonar scanner plugin.