Skip to content

Commit 196f7e2

Browse files
committed
[#286] Add a simple snapshot deploy Jenkinsfile
1 parent abfbc0a commit 196f7e2

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

ci/snapshot-publish/Jenkinsfile

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
* Jakarta Validation API
3+
*
4+
* License: Apache License, Version 2.0
5+
* See the license.txt file in the root directory or <http://www.apache.org/licenses/LICENSE-2.0>.
6+
*/
7+
8+
// Avoid running the pipeline on branch indexing
9+
if (currentBuild.getBuildCauses().toString().contains('BranchIndexingCause')) {
10+
print "INFO: Build skipped due to trigger being Branch Indexing"
11+
currentBuild.result = 'NOT_BUILT'
12+
return
13+
}
14+
15+
pipeline {
16+
tools {
17+
jdk 'openjdk-jdk25-latest'
18+
}
19+
options {
20+
// Wait for 1h before publishing snapshots, in case there's more commits.
21+
quietPeriod 3600
22+
// In any case, never publish snapshots more than once per hour.
23+
rateLimitBuilds(throttle: [count: 1, durationName: 'hour', userBoost: true])
24+
25+
buildDiscarder(logRotator(numToKeepStr: '3', artifactNumToKeepStr: '3'))
26+
disableConcurrentBuilds(abortPrevious: false)
27+
}
28+
stages {
29+
stage('Publish Snapshot to Maven Central') {
30+
steps {
31+
script {
32+
sh "mvn clean deploy"
33+
}
34+
}
35+
}
36+
}
37+
}

0 commit comments

Comments
 (0)