Skip to content

Commit 8948264

Browse files
authored
BR-105 Remove Coverity testing stage (#266)
1 parent 289d35e commit 8948264

File tree

1 file changed

+8
-39
lines changed

1 file changed

+8
-39
lines changed

Jenkinsfile

+8-39
Original file line numberDiff line numberDiff line change
@@ -122,47 +122,16 @@ pipeline {
122122
}
123123
}
124124
}
125-
stage('Quality Analysis') {
126-
parallel {
127-
stage('SonarCloud') {
128-
steps {
129-
withMaven(maven: 'maven-latest', jdk: 'jdk8-latest', globalMavenSettingsConfig: 'default-global-settings', mavenSettingsConfig: 'codice-maven-settings', mavenOpts: '${LARGE_MVN_OPTS} ${LINUX_MVN_RANDOM}') {
130-
withCredentials([string(credentialsId: 'SonarQubeGithubToken', variable: 'SONARQUBE_GITHUB_TOKEN'), string(credentialsId: 'cxbot-sonarcloud', variable: 'SONAR_TOKEN')]) {
131-
script {
132-
// If this build is not a pull request, run sonar scan. otherwise run incremental scan
133-
if (env.CHANGE_ID == null) {
134-
sh 'mvn -q -B -Dcheckstyle.skip=true org.jacoco:jacoco-maven-plugin:prepare-agent install sonar:sonar -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=$SONAR_TOKEN -Dsonar.organization=cx -Dsonar.projectKey=ac -Dsonar.exclusions=${COVERAGE_EXCLUSIONS} -pl !$ITESTS $DISABLE_DOWNLOAD_PROGRESS_OPTS'
135-
} else {
136-
sh 'mvn -q -B -Dcheckstyle.skip=true org.jacoco:jacoco-maven-plugin:prepare-agent install sonar:sonar -Dsonar.github.pullRequest=${CHANGE_ID} -Dsonar.github.oauth=${SONARQUBE_GITHUB_TOKEN} -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=$SONAR_TOKEN -Dsonar.organization=cx -Dsonar.projectKey=ac -Dsonar.exclusions=${COVERAGE_EXCLUSIONS} -pl !$ITESTS -Dgib.enabled=true -Dgib.referenceBranch=/refs/remotes/origin/$CHANGE_TARGET $DISABLE_DOWNLOAD_PROGRESS_OPTS'
137-
}
138-
}
139-
}
140-
}
141-
}
142-
}
143-
// Coverity will be skipped on all PR builds
144-
stage('Coverity') {
145-
agent { label 'linux-medium' }
146-
steps {
147-
retry(3) {
148-
checkout scm
149-
}
125+
stage('Sonar Cloud') {
126+
steps {
127+
withMaven(maven: 'maven-latest', jdk: 'jdk8-latest', globalMavenSettingsConfig: 'default-global-settings', mavenSettingsConfig: 'codice-maven-settings', mavenOpts: '${LARGE_MVN_OPTS} ${LINUX_MVN_RANDOM}') {
128+
withCredentials([string(credentialsId: 'SonarQubeGithubToken', variable: 'SONARQUBE_GITHUB_TOKEN'), string(credentialsId: 'cxbot-sonarcloud', variable: 'SONAR_TOKEN')]) {
150129
script {
151-
if (env.BRANCH_NAME != 'master') {
152-
echo "Coverity is only run on master"
130+
// If this build is not a pull request, run sonar scan. otherwise run incremental scan
131+
if (env.CHANGE_ID == null) {
132+
sh 'mvn -q -B -Dcheckstyle.skip=true org.jacoco:jacoco-maven-plugin:prepare-agent install sonar:sonar -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=$SONAR_TOKEN -Dsonar.organization=cx -Dsonar.projectKey=ac -Dsonar.exclusions=${COVERAGE_EXCLUSIONS} -pl !$ITESTS $DISABLE_DOWNLOAD_PROGRESS_OPTS'
153133
} else {
154-
withMaven(maven: 'maven-latest', jdk: 'jdk8-latest', globalMavenSettingsConfig: 'default-global-settings', mavenSettingsConfig: 'codice-maven-settings', mavenOpts: '${LINUX_MVN_RANDOM}') {
155-
withCredentials([string(credentialsId: 'admin-console-coverity-token', variable: 'COVERITY_TOKEN')]) {
156-
withEnv(["PATH=${tool 'coverity-linux'}/bin:${env.PATH}"]) {
157-
configFileProvider([configFile(fileId: 'coverity-maven-settings', replaceTokens: true, variable: 'MAVEN_SETTINGS')]) {
158-
echo sh(returnStdout: true, script: 'env')
159-
sh 'cov-build --dir cov-int mvn -DskipTests=true -DskipStatic=true install -B --settings $MAVEN_SETTINGS $DISABLE_DOWNLOAD_PROGRESS_OPTS'
160-
sh 'tar czvf ac.tgz cov-int'
161-
sh 'curl --form token=$COVERITY_TOKEN --form [email protected] --form [email protected] --form version="master" --form description="Description: Admin Console CI Build" https://scan.coverity.com/builds?project=connexta%2Fadmin-console'
162-
}
163-
}
164-
}
165-
}
134+
sh 'mvn -q -B -Dcheckstyle.skip=true org.jacoco:jacoco-maven-plugin:prepare-agent install sonar:sonar -Dsonar.github.pullRequest=${CHANGE_ID} -Dsonar.github.oauth=${SONARQUBE_GITHUB_TOKEN} -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=$SONAR_TOKEN -Dsonar.organization=cx -Dsonar.projectKey=ac -Dsonar.exclusions=${COVERAGE_EXCLUSIONS} -pl !$ITESTS -Dgib.enabled=true -Dgib.referenceBranch=/refs/remotes/origin/$CHANGE_TARGET $DISABLE_DOWNLOAD_PROGRESS_OPTS'
166135
}
167136
}
168137
}

0 commit comments

Comments
 (0)