Update Jenkinsfile
Some checks failed
ecommerce-backend/pipeline/head There was a failure building this commit
Some checks failed
ecommerce-backend/pipeline/head There was a failure building this commit
This commit is contained in:
20
Jenkinsfile
vendored
20
Jenkinsfile
vendored
@@ -31,6 +31,26 @@ pipeline {
|
||||
}
|
||||
}
|
||||
|
||||
stage('Install SonarScanner') {
|
||||
steps {
|
||||
sh '''
|
||||
if [ ! -f /opt/sonar-scanner/bin/sonar-scanner ]; then
|
||||
echo "Installing sonar-scanner..."
|
||||
cd /opt
|
||||
wget -q https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-5.0.1.3006-linux.zip
|
||||
unzip -q sonar-scanner-cli-5.0.1.3006-linux.zip
|
||||
mv sonar-scanner-5.0.1.3006-linux sonar-scanner
|
||||
chmod +x /opt/sonar-scanner/jre/bin/*
|
||||
apk add --no-cache openjdk17 gcompat libc6-compat
|
||||
sed -i 's/use_embedded_jre=true/use_embedded_jre=false/' /opt/sonar-scanner/bin/sonar-scanner
|
||||
echo "sonar-scanner installed successfully"
|
||||
else
|
||||
echo "sonar-scanner already installed, skipping..."
|
||||
fi
|
||||
'''
|
||||
}
|
||||
}
|
||||
|
||||
stage('SonarQube Scan') {
|
||||
steps {
|
||||
withSonarQubeEnv('SonarQube') {
|
||||
|
||||
Reference in New Issue
Block a user