Hello!
I am trying to get the SonarQube Scanner running on a Jenkins CI environment on Kubernetes. It works fine on my personal Macbook.
My project is a React-Native app with Typescript files that need to be analysed.
I’m using the npm package sonarqube-scanner
to get the scanner running. But for some unknown reason, the analysis starts but nothing gets executed.
It seems to be a certificate issue but I’m passing them as props. So I’m not sure.
The scanner binaries are installed at the root of the project for testing purpose.
- SonarQube Enterprise 7.9.1
- SonarQube Scanner 4.5.0
- SonarJS 6.2.2
- SonarTS 2.1
Would you have any idea what I’m doing wrong?
Thanks!
These are the analysis logs I get from our CI:
[14:44:46] Starting analysis (with local install of the SonarScanner)...
[14:44:46] Getting info from "package.json" file
[14:44:46] Trying to find a local install of the SonarScanner
pure virtual method called
terminate called without an active exception
[14:44:47] Local install of Sonarscanner found. Using it.
[14:44:47] Starting analysis...
[14:44:47] Getting info from "package.json" file
[14:44:47] Checking if executable exists: sonarqube-scanner-ci/.sonar/native-sonar-scanner/sonar-scanner-4.5.0.2216-linux/bin/sonar-scanner
[14:44:47] Platform binaries for SonarScanner found. Using it.
INFO: Scanner configuration file: /home/jenkins/agent/workspace/myProject_PR-3163/sonarqube-scanner-ci/.sonar/native-sonar-scanner/sonar-scanner-4.5.0.2216-linux/conf/sonar-scanner.properties
INFO: Project root configuration file: NONE
14:44:47.869 INFO: SonarScanner 4.5.0.2216
14:44:47.872 INFO: Java 11.0.3 AdoptOpenJDK (64-bit)
14:44:47.872 INFO: Linux 4.14.209-160.339.amzn2.x86_64 amd64
14:44:47.872 INFO: SONAR_SCANNER_OPTS=-Djavax.net.ssl.trustStore=/usr/local/share/ca-certificates/ -Djavax.net.ssl.trustStorePassword=changeit
14:44:48.120 DEBUG: keyStore is :
14:44:48.120 DEBUG: keyStore type is : pkcs12
14:44:48.120 DEBUG: keyStore provider is :
14:44:48.121 DEBUG: init keystore
14:44:48.121 DEBUG: init keymanager of type SunX509
14:44:48.283 DEBUG: Create: /root/.sonar/cache
14:44:48.284 INFO: User cache: /root/.sonar/cache
14:44:48.284 DEBUG: Create: /root/.sonar/cache/_tmp
14:44:48.288 DEBUG: Extract sonar-scanner-api-batch in temp...
14:44:48.292 DEBUG: Get bootstrap index...
14:44:48.293 DEBUG: Download: http://my-server.com/batch/index
[14:44:48] Analysis finished.
Done in 3.82s.
Done in 2.59s.
And this is my configuration:
const options = {
'sonar.projectKey': 'myProject',
'sonar.projectName': 'myProject',
'sonar.projectVersion': '1.0.0',
'sonar.sources': './packages',
'sonar.sourceEncoding': 'UTF-8',
'sonar.test.inclusions': '**/__tests__/*.tsx,**/__tests__/*.ts',
'sonar.exclusions': '**/*.java,**/*.kt,**/*.swift,**/*.m',
'sonar.javascript.lcov.reportPaths': './coverage/lcov.info',
'sonar.javascript.node.maxspace': '8192',
}
scanner(
{
serverUrl: 'https://my-server.com',
token: 'my-token',
options,
},
() => process.exit(),
);