Backport snapshot-publish.Jenkinsfile

This commit is contained in:
Yoann Rodière 2022-07-12 15:43:40 +02:00
parent 8907bf7d8a
commit e1279c79e6
1 changed files with 51 additions and 0 deletions

View File

@ -0,0 +1,51 @@
/*
* See https://github.com/hibernate/hibernate-jenkins-pipeline-helpers
*/
@Library('hibernate-jenkins-pipeline-helpers@1.5') _
// 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 = 'ABORTED'
return
}
pipeline {
agent {
label 'Fedora'
}
tools {
jdk 'OpenJDK 8 Latest'
}
options {
rateLimitBuilds(throttle: [count: 1, durationName: 'hour', userBoost: true])
buildDiscarder(logRotator(numToKeepStr: '3', artifactNumToKeepStr: '3'))
disableConcurrentBuilds(abortPrevious: true)
}
stages {
stage('Checkout') {
steps {
checkout scm
}
}
stage('Publish') {
steps {
configFileProvider([
configFile(fileId: 'ci-hibernate.deploy.settings.maven', variable: 'MAVEN_SETTINGS_PATH')
]) {
sh '''./gradlew clean publishPublishedArtifactsPublicationToJboss-snapshots-repositoryRepository \
-Dmaven.settings=$MAVEN_SETTINGS_PATH \
--no-scan
'''
}
}
}
}
post {
always {
configFileProvider([configFile(fileId: 'job-configuration.yaml', variable: 'JOB_CONFIGURATION_FILE')]) {
notifyBuildResult maintainers: (String) readYaml(file: env.JOB_CONFIGURATION_FILE).notification?.email?.recipients
}
}
}
}