1- @Library (' hibernate-jenkins-pipeline-helpers@1.5 ' ) _
1+ @Library (' hibernate-jenkins-pipeline-helpers@1.17 ' ) _
22
33import org.hibernate.jenkins.pipeline.helpers.version.Version
44
@@ -14,25 +14,6 @@ pipeline {
1414 buildDiscarder logRotator(daysToKeepStr : ' 30' , numToKeepStr : ' 10' )
1515 disableConcurrentBuilds(abortPrevious : false )
1616 }
17- parameters {
18- string(
19- name : ' RELEASE_VERSION' ,
20- defaultValue : ' ' ,
21- description : ' The version to be released, e.g. 1.0.0.Final.' ,
22- trim : true
23- )
24- string(
25- name : ' DEVELOPMENT_VERSION' ,
26- defaultValue : ' ' ,
27- description : ' The next version to be used after the release, e.g. 1.0.1-SNAPSHOT.' ,
28- trim : true
29- )
30- booleanParam(
31- name : ' RELEASE_DRY_RUN' ,
32- defaultValue : false ,
33- description : ' If true, just simulate the release, without pushing any commits or tags, and without uploading any artifacts.'
34- )
35- }
3617 stages {
3718 stage(' Build' ) {
3819 steps {
@@ -41,47 +22,5 @@ pipeline {
4122 }
4223 }
4324 }
44- stage(' Release' ) {
45- when {
46- beforeAgent true
47- // Releases must be triggered explicitly with parameters
48- expression { return params. RELEASE_VERSION }
49- }
50- steps {
51- script {
52- // Check that all the necessary parameters are set
53- if (! params. RELEASE_VERSION ) {
54- throw new IllegalArgumentException (" Missing value for parameter RELEASE_VERSION." )
55- }
56- if (! params. DEVELOPMENT_VERSION ) {
57- throw new IllegalArgumentException (" Missing value for parameter DEVELOPMENT_VERSION." )
58- }
59-
60- def releaseVersion = Version . parseReleaseVersion(params. RELEASE_VERSION )
61- def developmentVersion = Version . parseDevelopmentVersion(params. DEVELOPMENT_VERSION )
62- echo " Performing full release for version ${ releaseVersion.toString()} "
63-
64- withMaven(mavenSettingsConfig : params. RELEASE_DRY_RUN ? null : ' ci-hibernate.deploy.settings.maven' ,
65- mavenLocalRepo : env. WORKSPACE_TMP + ' /.m2repository' ) {
66- configFileProvider([configFile(fileId : ' release.config.ssh' , targetLocation : env. HOME + ' /.ssh/config' ),
67- configFile(fileId : ' release.config.ssh.knownhosts' , targetLocation : env. HOME + ' /.ssh/known_hosts' )]) {
68- sshagent([' ed25519.Hibernate-CI.github.com' ]) {
69- sh ' cat $HOME/.ssh/config'
70- sh """ \
71- ./mvnw release:prepare \
72- -Dtag=${ releaseVersion.toString()} \
73- -DreleaseVersion=${ releaseVersion.toString()} \
74- -DdevelopmentVersion=${ developmentVersion.toString()} \
75- -Prelease \
76- """
77- sh """ \
78- ./mvnw release:perform ${ params.RELEASE_DRY_RUN ? '-DdryRun' : ''} -Prelease \
79- """
80- }
81- }
82- }
83- }
84- }
85- }
8625 }
87- }
26+ }
0 commit comments