@@ -11,6 +11,10 @@ def signingArgs = '-PsigningKeyFile=$SIGNING_FILE -PsigningKeyId=$SIGNING_ID -Ps
11
11
def gitlabRepoArgs = ' -PgitlabUrl=$GITLAB_URL -PgitlabPrivateToken=$GITLAB_TOKEN'
12
12
def uploadRepoArgsCentral = ' -PsonatypeUsername=$OSSRH_LOGIN_USR -PsonatypePassword=$OSSRH_LOGIN_PSW'
13
13
14
+ boolean startedByTimer = currentBuild. getBuildCauses(' hudson.triggers.TimerTrigger$TimerTriggerCause' ). size() > 0
15
+ def buildCauses = currentBuild. getBuildCauses()
16
+ echo " startedByTimer=$startedByTimer , build causes: $buildCauses "
17
+
14
18
// https://jenkins.io/doc/book/pipeline/syntax/
15
19
pipeline {
16
20
agent { label ' java' }
@@ -146,11 +150,17 @@ pipeline {
146
150
147
151
success {
148
152
updateGitlabCommitStatus name : ' build' , state : ' success'
149
- // Trigger integration tests in GitLab
150
- // URL configured like <host>/api/v4/projects/<id>/trigger/pipeline?token=<token>
151
- // Note: do not fail on error in case ref does not exist, only output response
152
- // --silent --show-error disable progress output but still show errors
153
- sh ' curl --silent --show-error -X POST "$GITLAB_INTEG_TESTS_TRIGGER_URL&ref=$GIT_BRANCH"'
153
+ script {
154
+ if (startedByTimer) {
155
+ echo " Started by timer, not triggering integration tests"
156
+ } else {
157
+ // Trigger integration tests in GitLab
158
+ // URL configured like <host>/api/v4/projects/<id>/trigger/pipeline?token=<token>
159
+ // Note: do not fail on error in case ref does not exist, only output response
160
+ // --silent --show-error disable progress output but still show errors
161
+ sh ' curl --silent --show-error -X POST "$GITLAB_INTEG_TESTS_TRIGGER_URL&ref=$GIT_BRANCH"'
162
+ }
163
+ }
154
164
}
155
165
}
156
166
}
0 commit comments