Skip to content

Commit

Permalink
test: Re-enable SonarQube coverage check
Browse files Browse the repository at this point in the history
  • Loading branch information
avoinea committed Sep 28, 2023
1 parent c947eac commit 543cdc7
Showing 1 changed file with 29 additions and 29 deletions.
58 changes: 29 additions & 29 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -215,36 +215,36 @@ pipeline {
}
}

// stage('SonarQube compare to master') {
// when {
// anyOf {
// allOf {
// not { environment name: 'CHANGE_ID', value: '' }
// environment name: 'CHANGE_TARGET', value: 'develop'
// }
// allOf {
// environment name: 'CHANGE_ID', value: ''
// branch 'develop'
// not { changelog '.*^Automated release [0-9\\.]+$' }
// }
// }
// }
// steps {
// node(label: 'docker') {
// script {
// sh '''docker pull eeacms/gitflow'''
// sh '''echo "Error" > checkresult.txt'''
// catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
// sh '''set -o pipefail; docker run -i --rm --name="$BUILD_TAG-gitflow-sn" -e GIT_BRANCH="$BRANCH_NAME" -e GIT_NAME="$GIT_NAME" eeacms/gitflow /checkSonarqubemaster.sh | grep -v "Found script" | tee checkresult.txt'''
// }
stage('SonarQube compare to master') {
when {
anyOf {
allOf {
not { environment name: 'CHANGE_ID', value: '' }
environment name: 'CHANGE_TARGET', value: 'develop'
}
allOf {
environment name: 'CHANGE_ID', value: ''
branch 'develop'
not { changelog '.*^Automated release [0-9\\.]+$' }
}
}
}
steps {
node(label: 'docker') {
script {
sh '''docker pull eeacms/gitflow'''
sh '''echo "Error" > checkresult.txt'''
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
sh '''set -o pipefail; docker run -i --rm --name="$BUILD_TAG-gitflow-sn" -e GIT_BRANCH="$BRANCH_NAME" -e GIT_NAME="$GIT_NAME" eeacms/gitflow /checkSonarqubemaster.sh | grep -v "Found script" | tee checkresult.txt'''
}

// publishChecks name: 'SonarQube', title: 'Sonarqube Code Quality Check', summary: "Quality check on the SonarQube metrics from branch develop, comparing it with the ones from master branch. No bugs are allowed",
// text: readFile(file: 'checkresult.txt'), conclusion: "${currentBuild.currentResult}",
// detailsURL: "${env.BUILD_URL}display/redirect"
// }
// }
// }
// }
publishChecks name: 'SonarQube', title: 'Sonarqube Code Quality Check', summary: "Quality check on the SonarQube metrics from branch develop, comparing it with the ones from master branch. No bugs are allowed",
text: readFile(file: 'checkresult.txt'), conclusion: "${currentBuild.currentResult}",
detailsURL: "${env.BUILD_URL}display/redirect"
}
}
}
}

stage('Pull Request') {
when {
Expand Down

0 comments on commit 543cdc7

Please sign in to comment.