0

My employer has provided me with 3 different RHEL servers, each installed with Jenkins, Jmeter and Sonarqube separately. I have to create a CICD pipeline integrating all these components. Can anyone point me in the right direction as to how should I go about doing that ? This is my first time working with Jenkins pipelines, so, apologies if it has already been asked before.

SkyH0rn
  • 13
  • 2
  • Seems like an oddball/uninformed configuration. Jenkins usually operates as controller + agents where the jobs/pipelines run on agents (other servers). Sonarqube code analysis takes place as a step in a Jenkins pipeline and uploads the results to Sonarqube server (there a 4 sq processes - app, web, elaaticsearch, computeengine) and also needs a back-end DB for the datastore. Neither Jenkins controller or Sonarqube are CPU intensive. Can't speak to JMeter, but it's still a step in the pipeline so invoked from agent step. You need agent VMs. [Pipelines](https://www.jenkins.io/doc/book/pipeline/) – Ian W Jun 01 '22 at 07:54

1 Answers1

0
  1. First of all get familiarized with Jenkins Distributed Builds, it's possible to connect so called "build agent" to Jenkins via SSH, JNLP or WebSocket so the job triggered on JMeter Master will be invoked on the build agent and the status and result will be returned back over the network

  2. JMeter is a pure Java application which can be executed as a command line application as sh pipeline step so it would be something like:

    stage('Run JMeter test') {
        steps {
            sh './path/to/your/jmeter/bin/jmeter.sh -t /path/to/your/testplan.jmx -f -l result.jtl'
        }
    }
    

    if you want to use Performance Plugin to create performance trend charts on the build dashboard and mark build as unstable or failed if SLAs are not met you can add a stage for this as well:

    stage('Performance Report') {
        steps {
            perfReport filterRegex: '', showTrendGraphs: true, sourceDataFiles: '**/*.jtl'
        }
    }
    
  3. For Sonarqube there are too many possible options, check out SonarScanner for Jenkins page and choose the one which matches your project/language

    stage('SonarQube') {
      def scannerHome = tool 'SonarScanner 4.0';
      withSonarQubeEnv('My SonarQube Server') { 
        sh "${scannerHome}/bin/sonar-scanner"
    }
    
Dmitri T
  • 159,985
  • 5
  • 83
  • 133