@@ -29,18 +29,28 @@ pipeline {
2929 nextVersionMatcher = null // release matcher as it's not serializable
3030
3131 env.PREVIOUS_RELEASE_CANDIDATE_ID = readParameter('PREVIOUS_RELEASE_CANDIDATE_ID')
32- def previousIdMatcher = env.PREVIOUS_RELEASE_CANDIDATE_ID =~ /(?<type>[SR])-(?<major>\d+)\.(?<minor>\d+)(\.(?<service>\d+))?(?<checkpoint>(M|RC)\d+[a-z]?)?-(?<date>\d{8})(?<time>\d{4})/
33- if (!previousIdMatcher.matches()) {
32+ def previousIdMatcher = null
33+ if ((previousIdMatcher = env.PREVIOUS_RELEASE_CANDIDATE_ID =~ /(?<type>[SR])-(?<major>\d+)\.(?<minor>\d+)(\.(?<service>\d+))?(?<checkpoint>(M|RC)\d+[a-z]?)?-(?<date>\d{8})(?<time>\d{4})/).matches()) {
34+ def checkpoint = previousIdMatcher.group('checkpoint')
35+ assignEnvVariable('PREVIOUS_RELEASE_VERSION_MAJOR', previousIdMatcher.group('major'))
36+ assignEnvVariable('PREVIOUS_RELEASE_VERSION_MINOR', previousIdMatcher.group('minor'))
37+ assignEnvVariable('PREVIOUS_RELEASE_CANDIDATE_TAG', "${PREVIOUS_RELEASE_VERSION_MAJOR}.${PREVIOUS_RELEASE_VERSION_MINOR}${checkpoint}")
38+ def previousServiceVersion = previousIdMatcher.group('service') ?: '0'
39+ assignEnvVariable('PREVIOUS_RELEASE_CANDIDATE_GIT_TAG', "${previousIdMatcher.group('type')}${PREVIOUS_RELEASE_VERSION_MAJOR}_${PREVIOUS_RELEASE_VERSION_MINOR}${(checkpoint || previousServiceVersion != '0') ? ('_' + previousServiceVersion) : ''}${checkpoint ? ('_' + checkpoint) : ''}")
40+
41+ } else if ((previousIdMatcher = env.PREVIOUS_RELEASE_CANDIDATE_ID =~ /I(?<date>\d{8})-(?<time>\d{4})/).matches()) {
42+ def buildPropertiesTxt = sh(script: "curl --fail https://download.eclipse.org/eclipse/downloads/drops4/${PREVIOUS_RELEASE_CANDIDATE_ID}/buildproperties.txt", returnStdout: true)
43+ def buildProperties = readProperties(text: buildPropertiesTxt)
44+ assignEnvVariable('PREVIOUS_RELEASE_VERSION_MAJOR', buildProperties.STREAMMajor.replace('"','')) // Remove surrounding quotes
45+ assignEnvVariable('PREVIOUS_RELEASE_VERSION_MINOR', buildProperties.STREAMMinor.replace('"','')) // Remove surrounding quotes
46+ assignEnvVariable('PREVIOUS_RELEASE_CANDIDATE_TAG', "${PREVIOUS_RELEASE_CANDIDATE_ID}")
47+ assignEnvVariable('PREVIOUS_RELEASE_CANDIDATE_GIT_TAG', "${PREVIOUS_RELEASE_CANDIDATE_ID}")
48+
49+ } else {
3450 error "Unexpected format for PREVIOUS_RELEASE_CANDIDATE_ID: ${PREVIOUS_RELEASE_CANDIDATE_ID}"
3551 }
36- def checkpoint = previousIdMatcher.group('checkpoint')
37- def previousReleaseVersionService = previousIdMatcher.group('service') ?: '0'
38- assignEnvVariable('PREVIOUS_RELEASE_VERSION_MAJOR', previousIdMatcher.group('major'))
39- assignEnvVariable('PREVIOUS_RELEASE_VERSION_MINOR', previousIdMatcher.group('minor'))
4052 assignEnvVariable('PREVIOUS_RELEASE_VERSION', "${PREVIOUS_RELEASE_VERSION_MAJOR}.${PREVIOUS_RELEASE_VERSION_MINOR}")
41- assignEnvVariable('PREVIOUS_RELEASE_CANDIDATE_TAG', "${PREVIOUS_RELEASE_VERSION}${checkpoint}")
4253 assignEnvVariable('PREVIOUS_RELEASE_CANDIDATE_I_BUILD', "I${previousIdMatcher.group('date')}-${previousIdMatcher.group('time')}")
43- assignEnvVariable('PREVIOUS_RELEASE_CANDIDATE_GIT_TAG', "${previousIdMatcher.group('type')}${PREVIOUS_RELEASE_VERSION_MAJOR}_${PREVIOUS_RELEASE_VERSION_MINOR}${(checkpoint || previousReleaseVersionService != '0') ? ('_' + previousReleaseVersionService) : ''}${checkpoint ? ('_' + checkpoint) : ''}")
4454 previousIdMatcher = null // release matcher as it's not serializable
4555
4656 //TODO: Read the dates from the calender instead of provide a structured document somewhere?
@@ -100,14 +110,11 @@ pipeline {
100110 }
101111 }
102112 stage('Update Maven Version') {
103- environment {
104- MAVEN_ARGS = '-U -B -ntp'
105- }
106113 steps {
107114 sh '''
108115 mvn org.eclipse.tycho:tycho-versions-plugin:set-version \
109116 -DnewVersion=${NEXT_RELEASE_VERSION}.0-SNAPSHOT
110- mvn -f eclipse-platform-parent/pom.xml --non-recursive org.eclipse. tycho:tycho -versions-plugin :set-property \
117+ mvn -f eclipse-platform-parent/pom.xml tycho-versions:set-property \
111118 -Dproperties=releaseVersion,releaseYear,releaseMonth \
112119 -DnewReleaseVersion=${NEXT_RELEASE_VERSION} \
113120 -DnewReleaseYear=${NEXT_RELEASE_YEAR} \
@@ -155,13 +162,13 @@ pipeline {
155162 "(?<prefix># Schedule:.*\\R)(?s).*(?<suffix>\\R'''\\))" : "\${prefix}${I_BUILD_SCHEDULE}\${suffix}",
156163 ])
157164
158- utilities.commitAllChangesExcludingSubmodules ("Update versions to ${NEXT_RELEASE_VERSION} in build scripts")
165+ gitCommitAllExcludingSubmodules ("Update versions to ${NEXT_RELEASE_VERSION} in build scripts")
159166 }
160167 }
161168 stage('Move previous version to current RC') {
162169 steps {
163170 sh '''
164- mvn -f eclipse-platform-parent/pom.xml --non-recursive org.eclipse. tycho:tycho -versions-plugin :set-property \
171+ mvn -f eclipse-platform-parent/pom.xml tycho-versions:set-property \
165172 -Dproperties=previous-release.baseline \
166173 "-DnewPrevious-release.baseline=https://download.eclipse.org/eclipse/updates/${PREVIOUS_RELEASE_VERSION}-I-builds/${PREVIOUS_RELEASE_CANDIDATE_I_BUILD}/"
167174 '''
@@ -183,7 +190,8 @@ pipeline {
183190 'previousReleaseVersion=.*' : "previousReleaseVersion=${PREVIOUS_RELEASE_CANDIDATE_TAG}",
184191 'previousReleaseVersionRepo=.*' : "previousReleaseVersionRepo=${PREVIOUS_RELEASE_VERSION}-I-builds",
185192 ])
186- utilities.commitAllChangesExcludingSubmodules("Move previous version to ${PREVIOUS_RELEASE_CANDIDATE_TAG} in build scripts")
193+
194+ gitCommitAllExcludingSubmodules("Move previous version to ${PREVIOUS_RELEASE_CANDIDATE_TAG} in build scripts")
187195 }
188196 }
189197 stage('Clear Qualifier-update files') {
@@ -243,7 +251,7 @@ pipeline {
243251 ])
244252 sh "mv cje-production/streams/repositories_master.txt cje-production/streams/repositories_${MAINTENANCE_BRANCH}.txt"
245253
246- utilities.commitAllChangesExcludingSubmodules ("Move ${PREVIOUS_RELEASE_VERSION}-I builds to ${MAINTENANCE_BRANCH} branch")
254+ gitCommitAllExcludingSubmodules ("Move ${PREVIOUS_RELEASE_VERSION}-I builds to ${MAINTENANCE_BRANCH} branch")
247255
248256 // Switch back to master for subsequent parts of this pipeline
249257 sh 'git checkout master'
@@ -274,7 +282,7 @@ pipeline {
274282 --fixed-strings "${PREVIOUS_RELEASE_VERSION}")
275283 # The eclipse-platform-parent/pom.xml contains the previous version in the baseline repository variable
276284 if [[ -z "${matchingFiles}" ]] || [[ "${matchingFiles}" == 'eclipse-platform-parent/pom.xml' ]]; then
277- echo "No unexpected references to previous version ${PREVIOUS_RELEASE_VERSION} found: "
285+ echo "No unexpected references to previous version ${PREVIOUS_RELEASE_VERSION} found. "
278286 exit 0
279287 else
280288 echo "References to previous version ${PREVIOUS_RELEASE_VERSION} found:"
@@ -373,7 +381,7 @@ pipeline {
373381 - Updating the release version to `${NEXT_RELEASE_VERSION}` across build scripts
374382 - Updating the previous release version to the current Release-Candidate: `${PREVIOUS_RELEASE_CANDIDATE_ID}`
375383 """.stripIndent(), prBranch)
376-
384+
377385 def submodulePaths = sh(script: "git submodule --quiet foreach 'echo \$sm_path'", returnStdout: true).trim().split('\\s')
378386 for (submodulePath in submodulePaths) {
379387 def diff = sh(script:"cd ${submodulePath} && git diff master origin/master --shortstat", returnStdout: true).trim()
@@ -469,3 +477,7 @@ def replaceInFile(String filePath, Map<String,String> replacements) {
469477def replaceAllInFile(String filePath, Map<String,String> replacements) {
470478 utilities.replaceAllInFile(filePath, replacements)
471479}
480+
481+ def gitCommitAllExcludingSubmodules(String commitMessage) {
482+ utilities.gitCommitAllExcludingSubmodules(commitMessage)
483+ }
0 commit comments