Skip to content

Commit 204fa50

Browse files
committed
[RelEng] Make read of releaseName more robust in publication pipeline
Don't launch Maven to output the interpolated 'releaseName' property, but instead read the 'releaseYear' and 'releaseMonth' properties from the raw (eclipse-platform-parent/pom.xml) file. This avoids problems if at the time of the release (candidate) build a snapshot version was used, e.g. of Tycho, that's not available anymore at the time of the publication (because e.g. that Tycho version was released in the meantime).
1 parent 2e0adf5 commit 204fa50

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

JenkinsJobs/Releng/publishPromotedBuild.jenkinsfile

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,14 @@ pipeline {
4444
cd eclipse.platform.releng.aggregator
4545
git sparse-checkout set --no-cone eclipse-platform-parent/pom.xml
4646
git checkout
47-
48-
mvn -f eclipse-platform-parent help:evaluate -Dexpression=releaseName '-Doutput=${WORKSPACE}/releaseName-value.txt' \
49-
--batch-mode --no-transfer-progress --no-snapshot-updates
5047
"""
51-
assignEnvVariable('TRAIN_NAME', readFile('releaseName-value.txt').trim())
48+
def eclipseParentPOM = readFile('eclipse.platform.releng.aggregator/eclipse-platform-parent/pom.xml')
49+
def yearMatcher = eclipseParentPOM =~ /<releaseYear>(?<year>\d+)<\/releaseYear>/
50+
def monthMatcher = eclipseParentPOM =~ /<releaseMonth>(?<month>\d+)<\/releaseMonth>/
51+
if (!yearMatcher.find() || !monthMatcher.find()) {
52+
error "Eclipse Parent POM does not contain releaseYear or releaseMonth"
53+
}
54+
assignEnvVariable('TRAIN_NAME', yearMatcher.group('year') + '-' + monthMatcher.group('month'))
5255
if (!env.TRAIN_NAME) {
5356
error "TRAIN_NAME is empty."
5457
}

0 commit comments

Comments
 (0)