Skip to content

Commit b32c9ae

Browse files
committed
[RelEng] Relax replacement patterns in release preparation pipeline
This makes the preparation pipeline more flexible in case some build-properties have changed to something else than exactly the previous version as value in-between releases.
1 parent e84ab32 commit b32c9ae

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

JenkinsJobs/Releng/prepareNextDevCycle.jenkinsfile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -137,12 +137,12 @@ pipeline {
137137
}
138138
stage('Update build scripts') {
139139
steps {
140-
replaceInFile('cje-production/buildproperties.txt', [
141-
"RELEASE_VER=\"${PREVIOUS_RELEASE_VERSION}\"" : "RELEASE_VER=\"${NEXT_RELEASE_VERSION}\"",
142-
"STREAM=\"${PREVIOUS_RELEASE_VERSION}.0\"" : "STREAM=\"${NEXT_RELEASE_VERSION}.0\"",
143-
"STREAMMajor=\"${PREVIOUS_RELEASE_VERSION_MAJOR}\"" : "STREAMMajor=\"${NEXT_RELEASE_VERSION_MAJOR}\"",
144-
"STREAMMinor=\"${PREVIOUS_RELEASE_VERSION_MINOR}\"" : "STREAMMinor=\"${NEXT_RELEASE_VERSION_MINOR}\"",
145-
"ECLIPSE_RUN_REPO=\"https://download.eclipse.org/eclipse/updates/${PREVIOUS_RELEASE_VERSION}-I-builds/\"" : "ECLIPSE_RUN_REPO=\"https://download.eclipse.org/eclipse/updates/${NEXT_RELEASE_VERSION}-I-builds/\"",
140+
replaceAllInFile('cje-production/buildproperties.txt', [
141+
"RELEASE_VER=\".*\"" : "RELEASE_VER=\"${NEXT_RELEASE_VERSION}\"",
142+
"STREAM=\".*\"" : "STREAM=\"${NEXT_RELEASE_VERSION}.0\"",
143+
"STREAMMajor=\".*\"" : "STREAMMajor=\"${NEXT_RELEASE_VERSION_MAJOR}\"",
144+
"STREAMMinor=\".*\"" : "STREAMMinor=\"${NEXT_RELEASE_VERSION_MINOR}\"",
145+
"ECLIPSE_RUN_REPO=\".*\"" : "ECLIPSE_RUN_REPO=\"https://download.eclipse.org/eclipse/updates/${NEXT_RELEASE_VERSION}-I-builds/\"",
146146
])
147147
replaceInFile('eclipse.platform.releng.tychoeclipsebuilder/eclipse.platform.repository/platform.p2.inf', [
148148
"${PREVIOUS_RELEASE_VERSION} Release" : "${NEXT_RELEASE_VERSION} Release",
@@ -463,7 +463,7 @@ def parseDate(String dateString) {
463463
}
464464

465465
def replaceInFile(String filePath, Map<String,String> replacements) {
466-
utilities.replaceInFile(filePath, replacements)
466+
utilities.replaceAllInFile(filePath, replacements.collectEntries{ k, v -> [java.util.regex.Pattern.quote(k), v] });
467467
}
468468

469469
def replaceAllInFile(String filePath, Map<String,String> replacements) {

JenkinsJobs/shared/utilities.groovy

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@ def setDryRun(boolean isDryRun) {
77
IS_DRY_RUN = isDryRun
88
}
99

10-
def replaceInFile(String filePath, Map<String,String> replacements) {
11-
replaceAllInFile(filePath, replacements.collectEntries{ k, v -> [java.util.regex.Pattern.quote(k), v] });
12-
}
13-
1410
def replaceAllInFile(String filePath, Map<String,String> replacements) {
1511
def content = readFile(filePath)
1612
for (entry in replacements) {

0 commit comments

Comments
 (0)