Skip to content

Commit a58087d

Browse files
committed
fixing error
1 parent 5dae427 commit a58087d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Jenkinsfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ pipeline {
3333

3434
sonar_org = 'oracle'
3535
sonar_project_key = "${sonar_org}_weblogic-toolkit-ui"
36-
sonar_branch = sh(returnStdout: true, script: 'echo ${env.GIT_BRANCH} | awk -F/ \'{ print $2 }\'').trim()
3736
}
3837
stages {
3938
stage('Compute file version number') {
@@ -162,6 +161,7 @@ pipeline {
162161
echo "JAVA_HOME = ${JAVA_HOME}"
163162
sh "which java"
164163
sh "java -version"
164+
sh 'SONAR_BRANCH=$(echo $GIT_BRANCH | awk -F/ \'{ print $2 }\')'
165165

166166
withSonarQubeEnv('SonarCloud') {
167167
sh """
@@ -170,7 +170,7 @@ pipeline {
170170
echo "sonar.organization=${sonar_org}" >> ${sonarscanner_config_file}
171171
echo "sonar.projectKey=${sonar_project_key}" >> ${sonarscanner_config_file}
172172
echo "sonar.projectVersion=${version_prefix}" >> ${sonarscanner_config_file}
173-
echo "sonar.branch=${sonar_branch}" >> ${sonarscanner_config_file}
173+
echo 'sonar.branch=$SONAR_BRANCH' >> ${sonarscanner_config_file}
174174
echo "sonar.javascript.lcov.reportPaths=${lcov_report_paths}" >> ${sonarscanner_config_file}
175175
echo "sonar.c.file.suffixes=-" >> ${sonarscanner_config_file}
176176
echo "sonar.cpp.file.suffixes=-" >> ${sonarscanner_config_file}

0 commit comments

Comments
 (0)