Skip to content

Commit 64dcf00

Browse files
committed
[I/Y-Build] Streamline environment variable computation and export
Avoid need for common-functions.shsource and buildproperties.shsource Replace createEnvfiles script Remove quotes around values in buildproperties files.
1 parent fe17caf commit 64dcf00

File tree

15 files changed

+101
-260
lines changed

15 files changed

+101
-260
lines changed

JenkinsJobs/Builds/build.jenkinsfile

Lines changed: 42 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
@groovy.transform.Field
22
def BUILD = null
3+
@groovy.transform.Field
4+
def BUILD_PROPERTIES = null
35

46
pipeline {
57
options {
@@ -36,11 +38,13 @@ pipeline {
3638
CJE_ROOT = "${WORKSPACE}/cje-production"
3739
SCRIPTS = "${WORKSPACE}/scripts"
3840
AGG_DIR = "${CJE_ROOT}/gitCache/eclipse.platform.releng.aggregator"
41+
TMP_DIR = 'tmp'
3942
logDir = "$CJE_ROOT/buildlogs"
4043

4144
PRODUCTS_DIR = "${AGG_DIR}/products"
4245
SITES_DIR = "${AGG_DIR}/sites"
4346
PLATFORM_REPO_DIR = "${SITES_DIR}/eclipse-platform-repository/target/repository"
47+
ECLIPSE_BUILDER_DIR = "${AGG_DIR}/eclipse.platform.releng.tychoeclipsebuilder"
4448

4549
DROP_DIR = "${CJE_ROOT}/siteDir/eclipse/downloads/drops4"
4650
EQUINOX_DROP_DIR = "${CJE_ROOT}/siteDir/equinox/drops"
@@ -58,29 +62,24 @@ pipeline {
5862

5963
def job = utilities.matchPattern('Job name', "${JOB_BASE_NAME}", [ /(?<type>[IY])-build-(?<major>\d).(?<minor>\d+)/ ])
6064
// Load build properties and configuration from the properties and configuration file
61-
assignEnvVariable('BUILD_TYPE', job.type)
62-
def configurations = readJSON(file: "${WORKSPACE}/JenkinsJobs/buildConfigurations.json")
63-
BUILD = configurations["${BUILD_TYPE}"]
64-
assignEnvVariable('BUILD_TYPE_NAME', BUILD.typeName)
65+
def int epochSeconds = currentBuild.startTimeInMillis.intdiv(1000)
66+
def TIMESTAMP = sh(script: """TZ="America/New_York" date +%Y%m%d-%H%M --date='@${epochSeconds}'""", returnStdout: true)
67+
BUILD = readJSON(file: 'JenkinsJobs/buildConfigurations.json')["${job.type}"]
68+
BUILD_PROPERTIES = [
69+
TIMESTAMP: TIMESTAMP,
70+
BUILD_TYPE: job.type,
71+
BUILD_TYPE_NAME: BUILD.typeName,
72+
BUILD_ID: "${job.type}${TIMESTAMP}",
73+
]
74+
BUILD_PROPERTIES += readProperties(file: "${CJE_ROOT}/buildproperties.txt")
75+
BUILD_PROPERTIES.TEST_CONFIGURATIONS_EXPECTED = BUILD.tests.collect{ c ->
76+
"${testJobName(c)}_${c.os}.${c.ws}.${c.arch}_${c.javaVersion}"
77+
}.join(',')
78+
79+
// Export build properties
80+
BUILD_PROPERTIES.each{ key, value -> assignEnvVariable(key, value) }
6581
assignEnvVariable('GIT_SUBMODULE_BRANCHES', BUILD.branches ? BUILD.branches.collect{ name, branch -> "${name}:${branch}" }.join(',') : '')
66-
assignEnvVariable('TEST_NAME_PREFIX', "ep${job.major}${job.minor}${BUILD_TYPE}-unit")
67-
assignEnvVariable('TEST_CONFIGURATIONS_EXPECTED', BUILD.tests.collect{ c ->
68-
"${TEST_NAME_PREFIX}-${c.os}-${c.arch}-java${c.javaVersion}_${c.os}.${c.ws}.${c.arch}_${c.javaVersion}"
69-
}.join(','))
7082
}
71-
dir("${CJE_ROOT}") {
72-
sh '''#!/bin/bash -xe
73-
chmod +x mbscripts/*
74-
chmod +x $CJE_ROOT/scripts/notarizeMacApp.sh
75-
76-
./mbscripts/mb010_createEnvfiles.sh ${CJE_ROOT}/buildproperties.shsource 2>&1
77-
'''
78-
}
79-
exportPropertiesAsEnvironmentVariables("${CJE_ROOT}/buildproperties.properties", [
80-
'BUILD_ID',
81-
'STREAM', 'RELEASE_VER',
82-
'PREVIOUS_RELEASE_ID', 'PREVIOUS_RELEASE_VER',
83-
])
8483
}
8584
}
8685
stage('Clone and tag Build Inputs') {
@@ -118,7 +117,6 @@ pipeline {
118117
// Try to find the last tag of the current build type that is available as a promoted build
119118
// by checking the most recent 5 tags and seeing if an update site for it exists
120119
sh '''#!/bin/bash -xe
121-
source $CJE_ROOT/buildproperties.shsource
122120
updateSiteRootPath=${EP_ECLIPSE_UPDATES}/${STREAMMajor}.${STREAMMinor}-${BUILD_TYPE}-builds
123121
lastTagList=$(git tag --list "${BUILD_TYPE}*" | tail -n5 | tac)
124122
for lt in ${lastTagList}; do
@@ -148,8 +146,6 @@ pipeline {
148146
// Create git tags and push changes
149147
sshagent (['github-bot-ssh']) {
150148
sh '''#!/bin/bash -xe
151-
source $CJE_ROOT/buildproperties.shsource
152-
153149
function remoteURL {
154150
git config remote.origin.url | sed --expression 's,https://github.com/,git@github.com:,'
155151
}
@@ -181,8 +177,8 @@ pipeline {
181177
def exe = utilities.installDownloadableTool('eclipse', eclipsePlatformLatestRelease) + '/eclipse'
182178
assignEnvVariable('BASE_BUILDER_ECLIPSE_EXE', "${exe} -nosplash --launcher.suppressErrors")
183179
sh '''
184-
source $CJE_ROOT/buildproperties.shsource
185180
mkdir -p $CJE_ROOT/$TMP_DIR
181+
#TODO: How to treat old releases of p2-analyzers on maintanance branches?
186182
$BASE_BUILDER_ECLIPSE_EXE \
187183
-debug -consolelog -data $CJE_ROOT/$TMP_DIR/workspace-toolsinstall \
188184
-application org.eclipse.equinox.p2.director \
@@ -202,8 +198,6 @@ pipeline {
202198
steps {
203199
dir("${AGG_DIR}") {
204200
sh '''#!/bin/bash -xe
205-
source $CJE_ROOT/buildproperties.shsource
206-
207201
mvn clean install -pl :eclipse-sdk-prereqs,:org.eclipse.jdt.core.compiler.batch \
208202
-Dmaven.repo.local=${LOCAL_REPO} -DlocalEcjVersion=99.99 \
209203
-DcompilerBaselineMode=disable -DcompilerBaselineReplace=none
@@ -223,6 +217,13 @@ pipeline {
223217
2>&1 | tee ${logDir}/mb220_buildSdkPatch.sh.log
224218
# Capture the build log for the subsequent scan for comparator errors
225219
'''
220+
script {
221+
def mavenProperties = readProperties(file: 'eclipse-platform-parent/target/mavenproperties.properties')
222+
mavenProperties.each{ key, value -> assignEnvVariable(key, value) }
223+
BUILD_PROPERTIES += mavenProperties
224+
// Store complete build-properties
225+
writeFile(file: "${CJE_ROOT}/buildproperties.properties", text: BUILD_PROPERTIES.collect{ key, value -> "${key}=${value}"}.join('\n'))
226+
}
226227
}
227228
}
228229
}
@@ -232,13 +233,8 @@ pipeline {
232233
}
233234
steps {
234235
sh '''#!/bin/bash -xe
235-
source $CJE_ROOT/scripts/common-functions.shsource
236-
source $CJE_ROOT/buildproperties.shsource
237-
238236
# Gather maven properties
239237
mkdir -p ${DROP_DIR}/$BUILD_ID
240-
cp ${AGG_DIR}/eclipse-platform-parent/target/mavenproperties.properties ${DROP_DIR}/$BUILD_ID/mavenproperties.properties
241-
comparatorRepo=$(grep '^comparator.repo=' ${DROP_DIR}/${BUILD_ID}/mavenproperties.properties | cut -d'=' -f2-)
242238

243239
# Gather artifactcomparisons
244240
pushd ${AGG_DIR}
@@ -251,9 +247,10 @@ pipeline {
251247
#TODO: Generally try to avoid the need to capture the build log in a file/for teeing
252248
cp ${logDir}/mb220_buildSdkPatch.sh.log ${DROP_DIR}/$BUILD_ID/buildlogs/
253249

250+
#TODO: when outputting comparator error logs, add the baseline repository in the metadata (even on non-failure?)
254251
java \
255252
-DbuildDirectory=${DROP_DIR}/$BUILD_ID \
256-
-DcomparatorRepo=${comparatorRepo} \
253+
-DcomparatorRepo=${COMPARATOR_BASELINE} \
257254
-Djava.io.tmpdir=$CJE_ROOT/$TMP_DIR \
258255
${WORKSPACE}/scripts/releng/ComparatorSummaryExtractor.java
259256

@@ -262,13 +259,15 @@ pipeline {
262259
logSize=$(stat --format='%s' ${comparatorLog})
263260
if [[ ${logSize} -gt ${comparatorLogMinimumSize} ]]; then
264261
echo -e "DEBUG: found logsize greater an minimum. preparing message using ${link}"
265-
fn-write-property COMPARATOR_ERRORS_SUBJECT "\\"- Comparator Errors Found\\""
262+
echo "- Comparator Errors Found" > comparatorErrorsSubject
266263
else
267264
echo -e "DEBUG: comparator logSize of $logSize was not greater than comparatorLogMinimumSize of ${comparatorLogMinimumSize}"
268-
fn-write-property COMPARATOR_ERRORS_SUBJECT "\\"\\""
265+
touch comparatorErrorsSubject
269266
fi
270267
'''
271-
exportPropertiesAsEnvironmentVariables("${CJE_ROOT}/buildproperties.properties", [ 'COMPARATOR_ERRORS_SUBJECT' ])
268+
script { // Export subject to signal comparator errors, if any
269+
assignEnvVariable('COMPARATOR_ERRORS_SUBJECT', readFile("${WORKSPACE}/comparatorErrorsSubject").trim())
270+
}
272271
}
273272
}
274273
stage('Promote results') {
@@ -287,7 +286,6 @@ pipeline {
287286
}
288287
sh '''#!/bin/bash -xe
289288
cp $CJE_ROOT/buildproperties.* ${DROP_DIR}/${BUILD_ID}
290-
source $CJE_ROOT/buildproperties.shsource
291289

292290
mkdir -p ${DROP_DIR}/${BUILD_ID}/testresults/consolelogs
293291

@@ -323,6 +321,7 @@ pipeline {
323321

324322
notarizeLogDir=$CJE_ROOT/notarizeLog
325323
mkdir -p $notarizeLogDir
324+
chmod +x ${CJE_ROOT}/scripts/notarizeMacApp.sh
326325
pushd ${DROP_DIR}/${BUILD_ID}
327326
for macProduct in *.dmg; do
328327
(/bin/bash ${CJE_ROOT}/scripts/notarizeMacApp.sh ${macProduct} > $notarizeLogDir/${macProduct}.log 2>&1)&
@@ -388,7 +387,7 @@ pipeline {
388387
-DbuildId=$BUILD_ID \
389388
-DbuildLabel=$BUILD_ID \
390389
-DbuildWorkingArea=${AGG_DIR} \
391-
-DpreviousBaseURL=https://$DOWNLOAD_HOST/eclipse/downloads/drops4/$PREVIOUS_RELEASE_ID/eclipse-SDK-$PREVIOUS_RELEASE_VER-win32-x86_64.zip \
390+
-DpreviousBaseURL=https://download.eclipse.org/eclipse/downloads/drops4/$PREVIOUS_RELEASE_ID/eclipse-SDK-$PREVIOUS_RELEASE_VER-win32-x86_64.zip \
392391
-DpreviousBaselineName=Eclipse-SDK-$PREVIOUS_RELEASE_VER \
393392
-DpreviousBaselineFilename=eclipse-SDK-$PREVIOUS_RELEASE_VER-win32-x86_64.zip \
394393
-Djava.io.tmpdir=$CJE_ROOT/$TMP_DIR \
@@ -449,7 +448,6 @@ pipeline {
449448
}
450449
sh '''#!/bin/bash -xe
451450
cp $CJE_ROOT/buildproperties.* ${EQUINOX_DROP_DIR}/${BUILD_ID}
452-
source $CJE_ROOT/buildproperties.shsource
453451

454452
# Gather Equinox Starter Kit
455453
for file in ${PRODUCTS_DIR}/equinox-starterkit/target/products/*; do
@@ -460,6 +458,7 @@ pipeline {
460458

461459
notarizeLogDir=$CJE_ROOT/notarizeEqLog
462460
mkdir -p $notarizeLogDir
461+
chmod +x ${CJE_ROOT}/scripts/notarizeMacApp.sh
463462
pushd ${EQUINOX_DROP_DIR}/${BUILD_ID}
464463
(/bin/bash ${CJE_ROOT}/scripts/notarizeMacApp.sh EclipseRT-OSGi-StarterKit-$BUILD_ID-macosx-cocoa-x86_64.dmg > $notarizeLogDir/equinoxX64.log 2>&1)&
465464
popd
@@ -522,7 +521,6 @@ pipeline {
522521
steps {
523522
sshagent(['projects-storage.eclipse.org-bot-ssh']) {
524523
sh '''#!/bin/bash -xe
525-
source $CJE_ROOT/buildproperties.shsource
526524
repoPath=${EP_ECLIPSE_UPDATES}/${STREAMMajor}.${STREAMMinor}-${BUILD_TYPE}-builds/${BUILD_ID}
527525
ssh genie.releng@projects-storage.eclipse.org mkdir -p ${repoPath}
528526
scp -r ${PLATFORM_REPO_DIR}/. genie.releng@projects-storage.eclipse.org:${repoPath}/.
@@ -580,7 +578,7 @@ pipeline {
580578
steps {
581579
script {
582580
for (c in BUILD.tests) {
583-
build job: "${BUILD.testsFolder}/${TEST_NAME_PREFIX}-${c.os}-${c.arch}-java${c.javaVersion}", wait: false, parameters: [
581+
build job: "${BUILD.testsFolder}/${testJobName(c)}", wait: false, parameters: [
584582
string(name: 'buildId', value: "${BUILD_ID}"),
585583
string(name: 'testAgent', value: "${c.agent}"),
586584
]
@@ -650,10 +648,7 @@ def assignEnvVariable(String name, String value) {
650648
utilities.assignEnvVariable(name, value)
651649
}
652650

653-
def exportPropertiesAsEnvironmentVariables(String propertiesFile, Collection<String> exportedVariables){
654-
def properties = readProperties(file: propertiesFile, charset: 'UTF-8')
655-
for (envVar in exportedVariables) {
656-
def value = properties[envVar].trim()
657-
assignEnvVariable(envVar, value.startsWith('"') && value.endsWith('"') ? value.substring(1, value.length() - 1) : value)
658-
}
651+
@NonCPS
652+
def testJobName(Map<String, String> c) {
653+
return "ep${BUILD_PROPERTIES.STREAMMajor}${BUILD_PROPERTIES.STREAMMinor}${BUILD_PROPERTIES.BUILD_TYPE}-unit-${c.os}-${c.arch}-java${c.javaVersion}"
659654
}

JenkinsJobs/Builds/markBuild.jenkinsfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,5 +77,5 @@ pipeline {
7777
def readBuildProperty(String name) {
7878
def buildPropertiesURL = "https://download.eclipse.org/eclipse/downloads/drops4/${buildId}/buildproperties.properties"
7979
def buildProperties = readProperties(text: sh(script: "curl --fail ${buildPropertiesURL}", returnStdout: true))
80-
return buildProperties[name].replace('"','') // Remove surrounding quotes
80+
return buildProperties[name]
8181
}

JenkinsJobs/Cleanup/cleanupBuilds.jenkinsfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ pipeline {
4343
utilities = load "JenkinsJobs/shared/utilities.groovy"
4444
utilities.setDryRun(false)
4545
def buildProperties = readProperties(file: 'cje-production/buildproperties.txt')
46-
devVersionMajor = buildProperties.STREAMMajor.replace('"','').toInteger() // Remove surrounding quotes
47-
devVersionMinor = buildProperties.STREAMMinor.replace('"','').toInteger() // Remove surrounding quotes
48-
devVersionService = buildProperties.STREAMService.replace('"','').toInteger() // Remove surrounding quotes
46+
devVersionMajor = buildProperties.STREAMMajor.toInteger()
47+
devVersionMinor = buildProperties.STREAMMinor.toInteger()
48+
devVersionService = buildProperties.STREAMService.toInteger()
4949
}
5050
}
5151
}

JenkinsJobs/Releng/prepareNextDevCycle.jenkinsfile

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,12 @@ pipeline {
4747
assignEnvVariable('NEXT_RELEASE_VERSION_MINOR', nextVersion.minor)
4848

4949
echo "PREVIOUS_RELEASE_CANDIDATE_ID: ${PREVIOUS_RELEASE_CANDIDATE_ID}"
50-
def buildPropertiesTxt = sh(script: "curl --fail https://download.eclipse.org/eclipse/downloads/drops4/${PREVIOUS_RELEASE_CANDIDATE_ID}/buildproperties.txt", returnStdout: true)
51-
def buildProperties = readProperties(text: buildPropertiesTxt)
52-
assignEnvVariable('IS_JAVA_RELEASE_IMMINENT', !buildProperties.NEXT_JAVA_RELEASE_DATE.replace('"','').isEmpty()) // Remove surrounding quotes
50+
def buildProperties = utilities.loadBuildProperties("${PREVIOUS_RELEASE_CANDIDATE_ID}")
51+
assignEnvVariable('IS_JAVA_RELEASE_IMMINENT', !buildProperties.NEXT_JAVA_RELEASE_DATE.trim().isEmpty()) // Remove surrounding quotes
5352

5453
def previousRC = utilities.matchBuildIdentifier("${PREVIOUS_RELEASE_CANDIDATE_ID}", { iBuild ->
55-
iBuild.major = buildProperties.STREAMMajor.replace('"','') // Remove surrounding quotes
56-
iBuild.minor = buildProperties.STREAMMinor.replace('"','') // Remove surrounding quotes
54+
iBuild.major = buildProperties.STREAMMajor
55+
iBuild.minor = buildProperties.STREAMMinor
5756
assignEnvVariable('PREVIOUS_RELEASE_CANDIDATE_TAG', "${PREVIOUS_RELEASE_CANDIDATE_ID}")
5857
assignEnvVariable('PREVIOUS_RELEASE_CANDIDATE_GIT_TAG', "${PREVIOUS_RELEASE_CANDIDATE_ID}")
5958
}, { sBuild ->
@@ -153,12 +152,12 @@ pipeline {
153152
stage('Update build scripts') {
154153
steps {
155154
replaceAllInFile('cje-production/buildproperties.txt', [
156-
"RELEASE_VER=\".*\"" : "RELEASE_VER=\"${NEXT_RELEASE_VERSION}\"",
157-
"STREAM=\".*\"" : "STREAM=\"${NEXT_RELEASE_VERSION}.0\"",
158-
"STREAMMajor=\".*\"" : "STREAMMajor=\"${NEXT_RELEASE_VERSION_MAJOR}\"",
159-
"STREAMMinor=\".*\"" : "STREAMMinor=\"${NEXT_RELEASE_VERSION_MINOR}\"",
160-
"ECLIPSE_RUN_REPO=\".*\"" : "ECLIPSE_RUN_REPO=\"https://download.eclipse.org/eclipse/updates/${NEXT_RELEASE_VERSION}-I-builds/\"",
161-
"NEXT_JAVA_RELEASE_DATE=\".*\"" : "NEXT_JAVA_RELEASE_DATE=\"${NEXT_JAVA_RELEASE_DATE}\"",
155+
'RELEASE_VER=.*' : "RELEASE_VER=${NEXT_RELEASE_VERSION}",
156+
'STREAM=.*' : "STREAM=${NEXT_RELEASE_VERSION}.0",
157+
'STREAMMajor=.*' : "STREAMMajor=${NEXT_RELEASE_VERSION_MAJOR}",
158+
'STREAMMinor=.*' : "STREAMMinor=${NEXT_RELEASE_VERSION_MINOR}",
159+
'ECLIPSE_RUN_REPO=.*' : "ECLIPSE_RUN_REPO=https://download.eclipse.org/eclipse/updates/${NEXT_RELEASE_VERSION}-I-builds/",
160+
'NEXT_JAVA_RELEASE_DATE=.*' : "NEXT_JAVA_RELEASE_DATE=${NEXT_JAVA_RELEASE_DATE}",
162161
])
163162
replaceInFile('products/eclipse-platform/platform.p2.inf', [
164163
"${PREVIOUS_RELEASE_VERSION} Release" : "${NEXT_RELEASE_VERSION} Release",
@@ -197,10 +196,10 @@ pipeline {
197196
"-DnewPrevious-release.baseline=https://download.eclipse.org/eclipse/updates/${PREVIOUS_RELEASE_VERSION}-I-builds/${PREVIOUS_RELEASE_CANDIDATE_I_BUILD}/"
198197
'''
199198
replaceAllInFile('cje-production/buildproperties.txt', [
200-
'PREVIOUS_RELEASE_VER=".*"' : "PREVIOUS_RELEASE_VER=\"${PREVIOUS_RELEASE_CANDIDATE_TAG}\"",
201-
'PREVIOUS_RELEASE_REPO_ID=".*"' : "PREVIOUS_RELEASE_REPO_ID=\"${PREVIOUS_RELEASE_VERSION}-I-builds\"",
202-
'BASEBUILD_ID=".*"' : "BASEBUILD_ID=\"${PREVIOUS_RELEASE_CANDIDATE_I_BUILD}\"",
203-
'PREVIOUS_RELEASE_ID=".*"' : "PREVIOUS_RELEASE_ID=\"${PREVIOUS_RELEASE_CANDIDATE_ID}\"",
199+
'PREVIOUS_RELEASE_VER=.*' : "PREVIOUS_RELEASE_VER=${PREVIOUS_RELEASE_CANDIDATE_TAG}",
200+
'PREVIOUS_RELEASE_REPO_ID=.*' : "PREVIOUS_RELEASE_REPO_ID=${PREVIOUS_RELEASE_VERSION}-I-builds",
201+
'BASEBUILD_ID=.*' : "BASEBUILD_ID=${PREVIOUS_RELEASE_CANDIDATE_I_BUILD}",
202+
'PREVIOUS_RELEASE_ID=.*' : "PREVIOUS_RELEASE_ID=${PREVIOUS_RELEASE_CANDIDATE_ID}",
204203
])
205204

206205
gitCommitAllExcludingSubmodules("Move previous version to ${PREVIOUS_RELEASE_CANDIDATE_TAG} in build scripts")
@@ -431,7 +430,7 @@ def githubAPI = null
431430

432431
@NonCPS
433432
def assignEnvVariable(String name, Object value) {
434-
utilities.assignEnvVariable(name, value)
433+
utilities.assignEnvVariable(name, value?.toString())
435434
}
436435

437436
@NonCPS

JenkinsJobs/Releng/promoteBuild.jenkinsfile

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,10 @@ pipeline {
7676
})
7777
assignEnvVariable('REPO_ID', "I${build.date}-${build.time}")
7878

79-
def buildPropertiesTxt = sh(script: "curl --fail https://download.eclipse.org/eclipse/downloads/drops4/${DROP_ID}/buildproperties.txt", returnStdout: true)
80-
def buildProperties = readProperties(text: buildPropertiesTxt)
81-
assignEnvVariable('BUILD_MAJOR', buildProperties.STREAMMajor.replace('"','')) // Remove surrounding quotes
82-
assignEnvVariable('BUILD_MINOR', buildProperties.STREAMMinor.replace('"','')) // Remove surrounding quotes
83-
assignEnvVariable('BUILD_SERVICE', buildProperties.STREAMService.replace('"','')) // Remove surrounding quotes
79+
def buildProperties = utilities.loadBuildProperties("${DROP_ID}")
80+
assignEnvVariable('BUILD_MAJOR', buildProperties.STREAMMajor)
81+
assignEnvVariable('BUILD_MINOR', buildProperties.STREAMMinor)
82+
assignEnvVariable('BUILD_SERVICE', buildProperties.STREAMService)
8483

8584
if ("${CHECKPOINT}" ==~ /M\d+([a-z])?/ || "${CHECKPOINT}" ==~ /RC\d+([a-z])?/) { // milestone or RC promotion
8685
assignEnvVariable('DL_TYPE', 'S')
@@ -231,10 +230,10 @@ pipeline {
231230
-DnewPrevious-release.baseline="${RELEASE_P2_REPOSITORY}"
232231
'''
233232
utilities.replaceAllInFile('cje-production/buildproperties.txt', [
234-
'PREVIOUS_RELEASE_VER=".*?"' : "PREVIOUS_RELEASE_VER=\"${BUILD_MAJOR}.${BUILD_MINOR}\"",
235-
'PREVIOUS_RELEASE_REPO_ID=".*?"' : "PREVIOUS_RELEASE_REPO_ID=\"${BUILD_MAJOR}.${BUILD_MINOR}\"",
236-
'BASEBUILD_ID=".*?"' : "BASEBUILD_ID=\"${DL_DROP_ID}\"",
237-
'PREVIOUS_RELEASE_ID=".*?"' : "PREVIOUS_RELEASE_ID=\"${DL_DROP_ID}\"",
233+
'PREVIOUS_RELEASE_VER=.*' : "PREVIOUS_RELEASE_VER=${BUILD_MAJOR}.${BUILD_MINOR}",
234+
'PREVIOUS_RELEASE_REPO_ID=.*' : "PREVIOUS_RELEASE_REPO_ID=${BUILD_MAJOR}.${BUILD_MINOR}",
235+
'BASEBUILD_ID=.*' : "BASEBUILD_ID=${DL_DROP_ID}",
236+
'PREVIOUS_RELEASE_ID=.*' : "PREVIOUS_RELEASE_ID=${DL_DROP_ID}",
238237
])
239238
utilities.modifyJSON('JenkinsJobs/buildConfigurations.json') { builds ->
240239
// Remove old I/Y-build jobs for this release
@@ -256,7 +255,7 @@ pipeline {
256255
-DnewCbi-ecj-version="${ecjVersion}"
257256
"""
258257
utilities.replaceAllInFile('cje-production/buildproperties.txt', [
259-
'ECLIPSE_RUN_REPO="https://download.eclipse.org/eclipse/updates/.*"' : "ECLIPSE_RUN_REPO=\"${RELEASE_P2_REPOSITORY}\"",
258+
'ECLIPSE_RUN_REPO=https://download.eclipse.org/eclipse/updates/.*' : "ECLIPSE_RUN_REPO=${RELEASE_P2_REPOSITORY}",
260259
])
261260
utilities.gitCommitAllExcludingSubmodules("Update ${MAINTENANCE_BRANCH} branch with release version for ${BUILD_MAJOR}_${BUILD_MINOR}+ changes")
262261
}

JenkinsJobs/Releng/publishPromotedBuild.jenkinsfile

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,8 @@ pipeline {
5757
} else {
5858
error "RELEASE_TYPE, ${RELEASE_TYPE}, did not match any expected pattern."
5959
}
60-
61-
def eclipseParentPOM = sh(script: "curl --fail https://raw.githubusercontent.com/eclipse-platform/eclipse.platform.releng.aggregator/refs/tags/${buildId}/eclipse-platform-parent/pom.xml", returnStdout: true)
62-
def yearMatcher = eclipseParentPOM =~ /<releaseYear>(?<year>\d+)<\/releaseYear>/
63-
def monthMatcher = eclipseParentPOM =~ /<releaseMonth>(?<month>\d+)<\/releaseMonth>/
64-
if (!yearMatcher.find() || !monthMatcher.find()) {
65-
error "Eclipse Parent POM does not contain releaseYear or releaseMonth"
66-
}
67-
assignEnvVariable('TRAIN_NAME', yearMatcher.group('year') + '-' + monthMatcher.group('month'))
60+
def buildProperties = utilities.loadBuildProperties(buildId)
61+
assignEnvVariable('TRAIN_NAME', "${buildProperties.RELEASE_YEAR}-${buildProperties.RELEASE_MONTH}")
6862
if (!env.TRAIN_NAME) {
6963
error "TRAIN_NAME is empty."
7064
}

0 commit comments

Comments
 (0)