|
|
|
@ -9,7 +9,6 @@ pipeline {
|
|
|
|
|
JAVA_HOME = '/usr/lib/jvm/java-11-openjdk'
|
|
|
|
|
PATH = "${JAVA_HOME}/bin:${env.PATH}"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
stages {
|
|
|
|
|
stage('Initialize Variables') {
|
|
|
|
|
steps {
|
|
|
|
@ -45,26 +44,26 @@ pipeline {
|
|
|
|
|
echo "CHANGE_AUTHOR: ${env.CHANGE_AUTHOR}"
|
|
|
|
|
echo "CHANGE_BRANCH: ${env.CHANGE_BRANCH}"
|
|
|
|
|
echo "JAVA_HOME: ${JAVA_HOME}"
|
|
|
|
|
echo "PATH: ${PATH}"
|
|
|
|
|
echo "PATH: ${PATH}"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
stage('Check SonarQube Installation') {
|
|
|
|
|
steps {
|
|
|
|
|
script {
|
|
|
|
|
echo "Initial JAVA_HOME: ${env.JAVA_HOME}"
|
|
|
|
|
echo "Initial PATH: ${env.PATH}"
|
|
|
|
|
|
|
|
|
|
withEnv(["JAVA_HOME=${env.JAVA_HOME}", "PATH=${env.JAVA_HOME}/bin:${env.PATH}"]) {
|
|
|
|
|
sh """
|
|
|
|
|
java -version
|
|
|
|
|
${SCANNER_HOME}/bin/sonar-scanner --version
|
|
|
|
|
"""
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
stage('Check SonarQube Installation') {
|
|
|
|
|
steps {
|
|
|
|
|
script {
|
|
|
|
|
echo "Initial JAVA_HOME: ${env.JAVA_HOME}"
|
|
|
|
|
echo "Initial PATH: ${env.PATH}"
|
|
|
|
|
|
|
|
|
|
withEnv(["JAVA_HOME=${env.JAVA_HOME}", "PATH=${env.JAVA_HOME}/bin:${env.PATH}"]) {
|
|
|
|
|
sh """
|
|
|
|
|
java -version
|
|
|
|
|
${SCANNER_HOME}/bin/sonar-scanner --version
|
|
|
|
|
"""
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
stage('Fetch Pending Upstream Dependencies') {
|
|
|
|
|
steps {
|
|
|
|
@ -112,24 +111,24 @@ pipeline {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
stage('Code Quality Check') {
|
|
|
|
|
steps {
|
|
|
|
|
script {
|
|
|
|
|
def projectName = "device-mgt-core-${env.CHANGE_ID}"
|
|
|
|
|
def projectKey = "device-mgt-core-${env.CHANGE_ID}"
|
|
|
|
|
|
|
|
|
|
withSonarQubeEnv('sonar') {
|
|
|
|
|
sh """
|
|
|
|
|
$SCANNER_HOME/bin/sonar-scanner \
|
|
|
|
|
-Dsonar.projectName=${projectName} \
|
|
|
|
|
-Dsonar.projectKey=${projectKey} \
|
|
|
|
|
-Dsonar.java.binaries=target
|
|
|
|
|
"""
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
stage('Code Quality Check') {
|
|
|
|
|
steps {
|
|
|
|
|
script {
|
|
|
|
|
def projectName = "device-mgt-core-${env.CHANGE_ID}"
|
|
|
|
|
def projectKey = "device-mgt-core-${env.CHANGE_ID}"
|
|
|
|
|
|
|
|
|
|
withSonarQubeEnv('sonar') {
|
|
|
|
|
sh """
|
|
|
|
|
$SCANNER_HOME/bin/sonar-scanner \
|
|
|
|
|
-Dsonar.projectName=${projectName} \
|
|
|
|
|
-Dsonar.projectKey=${projectKey} \
|
|
|
|
|
-Dsonar.java.binaries=target
|
|
|
|
|
"""
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
stage('Report Job Status') {
|
|
|
|
|
steps {
|
|
|
|
|