Fosfor
Fosfor

Reputation: 191

To localhost from server deployment of Jenkins + Sonar

I managed to launch a SonarQube analysis of a git repository from a jenkins job and this in an automated local way. My jenkins is deployed on my port 8080 -> localhost: 8080 My Sonar is deployed on my port 9000 -> localhost: 9000

I now have to deploy it on a server where Jenkins is running but I do not know how to do it, I just managed to download the sonarQube plugin on the server Jenkins but about the rest, I do not know how to do it take.

Upvotes: 0

Views: 1288

Answers (1)

osowskit
osowskit

Reputation: 6334

My jenkins is deployed on my port 8080 -> localhost: 8080 My Sonar is deployed on my port 9000 -> localhost: 9000... deploy it on a server where Jenkins is running

For production systems, consider installing SonarQube and a Jenkins build agent on separate systems. These services will content for resources at scale and increase build times.


Overview

It is helpful to understand the flow of information. These are the most common steps for triggering automated scans.

  • User pushes code to Git services
  • Git provider sends event (webhook) to build environment (Jenkins on :8080)
  • The Jenkins server will schedule a configured job that executes the SonarQube Scanner Plugin on a Jenkins build agent. Note that some configurations may have a build agent on the same machine as the server.
  • When the scanner completes, it will send results to the SonarQube server (:9000) that is configured in Jenkins

Configuration

managed to download the sonarQube plugin on the server Jenkins

The main configuration will happen in the Jenkins Global Tool Configuration. Follow the instructions on this page to configure SonarQube Scanner and creating a job.

Simplified Steps

  1. Configure Jenkins to point to your SonarQube server

    Scroll down to the SonarQube Scanner configuration section and click on Add SonarQube Scanner. It is based on the typical Jenkins tool auto-installation. You can either choose to point to an already installed version of SonarQube Scanner (uncheck 'Install automatically') or tell Jenkins to grab the installer from a remote location (check 'Install automatically'):

  2. Add the SonarQube Scanner build step to your build

Upvotes: 1

Related Questions