From 7da5560cd4784b428395bd02b63a8aa763f29819 Mon Sep 17 00:00:00 2001 From: Alin Voinea Date: Thu, 28 Sep 2023 14:48:51 +0300 Subject: [PATCH] test: Re-enable SonarQube coverage check --- Jenkinsfile | 58 ++++++++++++++++++++++++++--------------------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index f775ba3..121b56a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -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 {