-
Notifications
You must be signed in to change notification settings - Fork 244
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move snapshot publishing to a separate Jenkinsfile
(cherry picked from commit 59d7b31)
- Loading branch information
1 parent
fbd0ac3
commit 4db6873
Showing
4 changed files
with
67 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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 'Worker&&Containers' | ||
} | ||
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]' | ||
} | ||
} | ||
} |