SonarScanner - build wrapper - charon

Im using SonarQube 10.2 on AKS with HELM, trying to get validation of the cfamily code into project, in Jenkins pipeline
SonarScaner is 4.5.0.2216
Jenkins agents run also on AKS

sh 'wget -P /home/jenkins https://WEBPAGE/static/cpp/build-wrapper-linux-x86.zip'
sh 'unzip /home/jenkins/build-wrapper-linux-x86.zip -d /home/jenkins/workspace'
sh '/home/jenkins/workspace/build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir /home/jenkins/workspace/build-wrapper-linux-x86/bw-output/ make clean all'
sh '$SCANNER_HOME/bin/sonar-scanner -X -Dproject.settings=/home/jenkins/workspace/sonarqube_test/PROJECTNAME/src/sonar-project.properties'

and before I have a stage with charon but not sure if its the correct one to be combined with wrapper

stage('Build') {
                steps {
                    sh '''#!/bin/bash
                        source /opt/charon/bin/source_me.sh
                        pwd
                        charon build-ws -vvv
                    '''
                }
            }

I want the project to finish the build with wrapper and see all the outcomes in our sonarqube, I know that something needs to be added here but not 100% sure
sh '/home/jenkins/workspace/build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir /home/jenkins/workspace/build-wrapper-linux-x86/bw-output/ make clean all'

After some thinking cfamily files / project get downloaded to

/home/jenkins/workspace/sonarqube_test/PROJECTNAME/src

How to make this with make / cmake as charon is a specific tool developed inside the company

Hi,

Welcome to the community!

Sorry, but I’m not quite following. It looks like you’ve already got the build-wrapper command in place with your make command. What’s missing?

As a side note, SonarScanner CLI 4.5.0 has some age on it at this point. You should upgrade.

 
Ann

Thanks for answer, got it working, unfortunately the build command was do extensive and complicated that I had to do compilation database way

1 Like