Add changes to reviewfile
pr-validation/core/pipeline/pr-master There was a failure building this commit Details

pull/515/head
prathabanKavin 2 months ago
parent 754bdc2b25
commit fe48e14c46

55
Jenkinsfile vendored

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

Loading…
Cancel
Save