Determine your technical debt using SonarQube - Creating the SonarQube project

Sep 29, 2017 1 min.

TL; DR SonarQube allows you to create projects. These projects will hold your code analysis results. You can configure a SQ project for each code repository or even for each branch to have different deltas. (ex my master builds every month, I want to see changes to the monthly and my dev builds daily so I want to see evolution on a day by day basis). Creating the project Go to “configuration”-> “Projects”-> “Management” then “create project”.

Determine your technical debt using SonarQube - Updating your build definitions

Sep 29, 2017 2 min.

TL; DR Static analysis will be executed when building your source base using the central build machine. You have two options to set this up with VSTS: Your project is “Visual Studio" related and leverages sln and cs/vb proj files: in that case you can leverage integrated pre and post build tasks provided by the SonarQube VSTS extension. Your project is not build using msbuild: in that case you must leverage the SonarQube CLI task.

Determine your technical debt using SonarQube - Creating and configuring a service account for VSTS in SonarQube

Sep 27, 2017 1 min.

TL; DR To prevent anyone from sending analysis results to our SonarQube installation, we need to secure the access to its services. To do so, we’ll configure a service account. Creating the service account From SonarQube, go to administration, security, users, and add an account. Next click on the “tokens" cell for the account we just created an generate a new personal access token. You can also refer to that documentation if you’re not sure how to generate a PAT https://docs.

Determine your technical debt using SonarQube - Setting up Azure Active directory for authentication

Sep 25, 2017 1 min.

TL; DR We will install and configure an add-on to delegate authentication to Azure Active Directory. This will allow our developers to use the same account between Visual Studio Team Services and SonarQube. Configuration of the authentication module Since version 5.4 SonarQube provides an additional plugin relying on the OAuth protocol to communicate with AAD. This will allow the users to leverage their corporate account to access SonarQube, providing SSO and simplifying the administrators job by having a central identity repository.

Determine your technical debt using SonarQube - Adding modules

Sep 22, 2017 1 min.

TL; DR Static analysis works by leveraging rules. These rules are grouped by language or language categories in modules that you can install. In addition to providing support for the subsequent languages, these modules can extend the native capabilities of SonarQube. Most of them are free, some are subject to commercial licenses. Installing Add-ons Open SonarQube and go to configuration, system, search for and install the modules that you’re interested in.

Determine your technical debt using SonarQube - Opening SonarQube’s ports

Sep 20, 2017 1 min.

TL; DR Open ports 22, 9000, 80 and 443 inbound on the VM. Details of the opening of ports Rather than repeating what is already documented, I will provide you with the link https://Github.com/baywet/azure-docker-SonarQube#step-2-opening-firewall-ports It is necessary to open the ports 22, 80, 443 and 9000 allowing respectively to access the machine remote shell, load http and https content, and access the management console.

Determine your technical debt using SonarQube - Installing the machine

Sep 18, 2017 1 min.

TL; DR We will update the machine, install docker, and provision the containers we need. Installation of docker and updating the machine Connect to the machine using SSH (Putty is a very good client for windows) and run the following commands: https://Github.com/baywet/azure-docker-SonarQube#step-4-Setup-docker Setting up containers, creating the certificates The containers are the components of our system managing the web traffic and providing the SonarQube service. To secure connections, we will also generate self-signed SSL certificates which is not the easiest thing to do when someone is not used to working with linux environments.

Determine your technical debt using SonarQube - Creating the database

Sep 15, 2017 1 min.

TL; DR Create a db sql azure with collation set to SQL_Latin1_General_CP1_CS_AS. Details of the database creation The SQL Azure database creation steps are already well described, crucial detail: use the following collation: SQL_Latin1_General_CP1_CS_AS. (and use a blank template) https://Github.com/baywet/azure-docker-SonarQube#step-3-create-the-azure-SQL-database Keep the database access settings (FQDN of the server, username, password, the database name) somewhere, we will need those later. Don’t forget to open the firewall of the SQL Server for connections from Azure.

Determine your technical debt using SonarQube - Provisioning the SonarQube VM

Sep 13, 2017 1 min.

TL; DR We’ll provision a ubuntu server in Azure, and install Putty and WinSCP on your local machine Details of provisioning Here is a link to a documentation explaining how to do it https://Github.com/baywet/azure-docker-SonarQube#step-1-create-the-virtual-machine-in-Azure This is! the machine is being provisioned! Meanwhile take the opportunity to download a SSH terminal if you don’t have one, I recommend https://www.PuTTY.org/ (you can also install WinSCP that will also provide a GUI to transfer files)

Determine your technical debt using SonarQube - What parts to use?

Sep 11, 2017 2 min.

TL; DR Planning, Sources, Build, deployment, testing: VSTS. Analysis: Azure VM (SonarQube), Azure SQL. Parts of our software factory Because we use a maximum of services cloud at 2toLead I realized the following installation: Source control: VSTS (git or tfsvc, doesn’t matter) Build system: build 2015 VSTS Build machine: provided by VSTS as a service SonarQube machine: Ubuntu Server hosted in Azure Data SonarQube: Azure SQL Database, 10 DTU Note that to facilitate the management of the SonarQube “box" we are going to install Docker on the ubuntu machine.