-
Notifications
You must be signed in to change notification settings - Fork 246
/
Copy pathJenkinsfile
53 lines (49 loc) · 1.27 KB
/
Jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/*
* SPDX-License-Identifier: Apache-2.0
* Copyright Red Hat Inc. and Hibernate Authors
*/
@Library('hibernate-jenkins-pipeline-helpers') _
// Avoid running the pipeline on branch indexing
if (currentBuild.getBuildCauses().toString().contains('BranchIndexingCause')) {
print "INFO: Build skipped due to trigger being Branch Indexing"
currentBuild.result = 'NOT_BUILT'
return
}
pipeline {
agent {
label 'Release'
}
tools {
maven 'Apache Maven 3.9'
jdk 'OpenJDK 21 Latest'
}
options {
// Wait for 1h before publishing snapshots, in case there's more commits.
quietPeriod 3600
// In any case, never publish snapshots more than once per hour.
rateLimitBuilds(throttle: [count: 1, durationName: 'hour', userBoost: true])
buildDiscarder(logRotator(numToKeepStr: '3', artifactNumToKeepStr: '3'))
disableConcurrentBuilds(abortPrevious: false)
}
stages {
stage('Publish') {
steps {
script {
withMaven(mavenSettingsConfig: 'ci-hibernate.deploy.settings.maven',
mavenLocalRepo: env.WORKSPACE_TMP + '/.m2repository') {
sh """mvn \
-Pci-build \
-DskipTests \
clean deploy \
"""
}
}
}
}
}
post {
always {
notifyBuildResult notifySuccessAfterSuccess: false, maintainers: '[email protected]'
}
}
}