2022-05-12 03:11:30 -04:00
|
|
|
/*
|
|
|
|
* See https://github.com/hibernate/hibernate-jenkins-pipeline-helpers
|
|
|
|
*/
|
2022-05-11 11:06:44 -04:00
|
|
|
@Library('hibernate-jenkins-pipeline-helpers@1.5') _
|
|
|
|
|
|
|
|
// Avoid running the pipeline on branch indexing
|
|
|
|
if (currentBuild.getBuildCauses().toString().contains('BranchIndexingCause')) {
|
2023-10-06 09:01:00 -04:00
|
|
|
print "INFO: Build skipped due to trigger being Branch Indexing"
|
|
|
|
currentBuild.result = 'NOT_BUILT'
|
|
|
|
return
|
2022-05-11 11:06:44 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
pipeline {
|
|
|
|
agent {
|
|
|
|
label 'Fedora'
|
|
|
|
}
|
|
|
|
tools {
|
|
|
|
jdk 'OpenJDK 11 Latest'
|
|
|
|
}
|
|
|
|
options {
|
|
|
|
rateLimitBuilds(throttle: [count: 1, durationName: 'hour', userBoost: true])
|
|
|
|
buildDiscarder(logRotator(numToKeepStr: '3', artifactNumToKeepStr: '3'))
|
2022-05-12 04:47:27 -04:00
|
|
|
disableConcurrentBuilds(abortPrevious: true)
|
2022-05-11 11:06:44 -04:00
|
|
|
}
|
|
|
|
stages {
|
|
|
|
stage('Checkout') {
|
|
|
|
steps {
|
|
|
|
checkout scm
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stage('Publish') {
|
|
|
|
steps {
|
|
|
|
withCredentials([
|
|
|
|
usernamePassword(credentialsId: 'ossrh.sonatype.org', usernameVariable: 'hibernatePublishUsername', passwordVariable: 'hibernatePublishPassword'),
|
|
|
|
usernamePassword(credentialsId: 'plugins.gradle.org', usernameVariable: 'hibernatePluginPortalUsername', passwordVariable: 'hibernatePluginPortalPassword'),
|
|
|
|
string(credentialsId: 'ge.hibernate.org-access-key', variable: 'GRADLE_ENTERPRISE_ACCESS_KEY'),
|
|
|
|
string(credentialsId: 'release.gpg.passphrase', variable: 'SIGNING_PASS'),
|
|
|
|
file(credentialsId: 'release.gpg.private-key', variable: 'SIGNING_KEYRING')
|
|
|
|
]) {
|
2022-05-12 03:10:01 -04:00
|
|
|
sh '''./gradlew clean publish \
|
2022-05-11 11:06:44 -04:00
|
|
|
-PhibernatePublishUsername=$hibernatePublishUsername \
|
|
|
|
-PhibernatePublishPassword=$hibernatePublishPassword \
|
2022-11-28 02:29:03 -05:00
|
|
|
-Pgradle.publish.key=$hibernatePluginPortalUsername \
|
|
|
|
-Pgradle.publish.secret=$hibernatePluginPortalPassword \
|
2022-05-11 11:06:44 -04:00
|
|
|
--no-scan \
|
|
|
|
-DsigningPassword=$SIGNING_PASS \
|
|
|
|
-DsigningKeyFile=$SIGNING_KEYRING \
|
2022-05-12 03:10:01 -04:00
|
|
|
'''
|
2022-05-11 11:06:44 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
post {
|
|
|
|
always {
|
2022-05-12 03:30:21 -04:00
|
|
|
configFileProvider([configFile(fileId: 'job-configuration.yaml', variable: 'JOB_CONFIGURATION_FILE')]) {
|
2022-05-12 04:47:27 -04:00
|
|
|
notifyBuildResult maintainers: (String) readYaml(file: env.JOB_CONFIGURATION_FILE).notification?.email?.recipients
|
2022-05-12 03:30:21 -04:00
|
|
|
}
|
2022-05-11 11:06:44 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|