Skip to content

Commit 6a66f78

Browse files
cloudant-sdks-automationricellis
authored andcommitted
ci(generated): skip staging/gauge on tag builds
Generated SDK source code using: - Generator version 3.106.0 - Specification version 1.0.0-dev0.1.28 - Automation (cloudant-sdks) version f153831
1 parent 451d92a commit 6a66f78

File tree

1 file changed

+21
-5
lines changed

1 file changed

+21
-5
lines changed

Jenkinsfile

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)