Checkout of front end & back end code in multiple folders within jenkin's ${WORKSPACE}
, as shown below
Frontend code is written in Angular(TypeScript) and built using npm
Backend code is written in Java and built using gradlew
Referring documentation for SonarQube scanner with Jenkins, here. I got the below piece of code to run SonarQube scanner for multi-language(angular & java) static code analysis
node {
stage('SCM') {
git 'https://github.com/foo/bar.git'
}
stage('SonarQube analysis') {
// requires SonarQube Scanner 2.8+
def scannerHome = tool 'SonarQube Scanner 2.8';
withSonarQubeEnv('My SonarQube Server') {
sh "${scannerHome}/bin/sonar-scanner"
}
}
}
As per below screenshot, below is the sonar scanner installation in jenkins:
1) Does def scannerHome = tool 'abc_install'; grab the SonarQube scanner configured in Jenkins?
2) Does sh "${scannerHome}/bin/sonar-scanner" perform static code analysis for both TypeScript & Java? in front-end-code & backend-code folder

