File tree Expand file tree Collapse file tree 1 file changed +21
-5
lines changed
Expand file tree Collapse file tree 1 file changed +21
-5
lines changed Original file line number Diff line number Diff line change @@ -68,12 +68,18 @@ pipeline {
6868 environment {
6969 scannerHome = tool ' SonarQubeScanner'
7070 }
71- // Scanning runs on dependabot core update and non-dependabot branches
71+ // Scanning runs on PRs (except dependabot for non- core updates) and primary branch
7272 when {
7373 anyOf {
74- branch pattern : / ^dependabot.*(?i)(ibm)[\. -].+sdk-core.*$/ , comparator : ' REGEXP'
75- not {
76- branch ' dependabot*'
74+ changeRequest()
75+ expression { env. BRANCH_IS_PRIMARY }
76+ }
77+ not {
78+ allOf {
79+ changeRequest branch : ' dependabot*' , comparator : ' GLOB'
80+ not {
81+ changeRequest branch : / ^dependabot.*(?i)(ibm)[\. -].+sdk-core.*$/ , comparator : ' REGEXP'
82+ }
7783 }
7884 }
7985 }
@@ -82,6 +88,11 @@ pipeline {
8288 }
8389 }
8490 stage(' Publish[staging]' ) {
91+ when {
92+ not {
93+ buildingTag()
94+ }
95+ }
8596 environment {
8697 STAGE_ROOT = " ${ ARTIFACTORY_URL_UP} /api/"
8798 }
@@ -105,6 +116,11 @@ pipeline {
105116 }
106117 }
107118 stage(' Run Gauge tests' ) {
119+ when {
120+ not {
121+ buildingTag()
122+ }
123+ }
108124 steps {
109125 script {
110126 buildResults = null
@@ -270,7 +286,7 @@ void defaultInit() {
270286
271287 scanCode = {
272288 withSonarQubeEnv(installationName : ' SonarQubeServer' ) {
273- sh " ${ scannerHome} /bin/sonar-scanner -Dsonar.qualitygate.wait=true -Dsonar.projectKey=cloudant-${ libName} -sdk -Dsonar.branch.name= ${ env.BRANCH_NAME } -Dsonar. exclusions=examples/**"
289+ sh " ${ scannerHome} /bin/sonar-scanner -Dsonar.qualitygate.wait=true -Dsonar.projectKey=cloudant-${ libName} -sdk -Dsonar.exclusions=examples/**"
274290 }
275291 }
276292}
You can’t perform that action at this time.
0 commit comments