Skip to content

Commit 47c1605

Browse files
committed
[RelEng] Create and update maintenance branch in release preparation
1 parent 3fe6755 commit 47c1605

File tree

4 files changed

+58
-89
lines changed

4 files changed

+58
-89
lines changed

JenkinsJobs/Releng/createMaintenanceBranch.groovy

Lines changed: 0 additions & 80 deletions
This file was deleted.

JenkinsJobs/Releng/prepareNextDevCycle.jenkinsfile

Lines changed: 58 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,18 @@ 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 =~ /(S|R)-(?<major>\d+)\.(?<minor>\d+)(\.\d+)?(?<checkpoint>(M|RC)\d+[a-z]?)?-(?<date>\d{8})(?<time>\d{4})/
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})/
3333
if (!previousIdMatcher.matches()) {
3434
error "Unexpected format for PREVIOUS_RELEASE_CANDIDATE_ID: ${PREVIOUS_RELEASE_CANDIDATE_ID}"
3535
}
36+
def checkpoint = previousIdMatcher.group('checkpoint')
37+
def previousReleaseVersionService = previousIdMatcher.group('service') ?: '0'
3638
assignEnvVariable('PREVIOUS_RELEASE_VERSION_MAJOR', previousIdMatcher.group('major'))
3739
assignEnvVariable('PREVIOUS_RELEASE_VERSION_MINOR', previousIdMatcher.group('minor'))
3840
assignEnvVariable('PREVIOUS_RELEASE_VERSION', "${PREVIOUS_RELEASE_VERSION_MAJOR}.${PREVIOUS_RELEASE_VERSION_MINOR}")
39-
assignEnvVariable('PREVIOUS_RELEASE_CANDIDATE_TAG', "${PREVIOUS_RELEASE_VERSION}${previousIdMatcher.group('checkpoint')}")
41+
assignEnvVariable('PREVIOUS_RELEASE_CANDIDATE_TAG', "${PREVIOUS_RELEASE_VERSION}${checkpoint}")
4042
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) : ''}")
4144
previousIdMatcher = null // release matcher as it's not serializable
4245

4346
//TODO: Read the dates from the calender instead of provide a structured document somewhere?
@@ -54,6 +57,7 @@ pipeline {
5457
assignEnvVariable('NEXT_RELEASE_YEAR', gaDate.year.toString())
5558
assignEnvVariable('NEXT_RELEASE_MONTH', String.format("%02d", gaDate.monthValue))
5659
assignEnvVariable('NEXT_RELEASE_NAME', "${NEXT_RELEASE_YEAR}-${NEXT_RELEASE_MONTH}")
60+
assignEnvVariable('MAINTENANCE_BRANCH', "R${PREVIOUS_RELEASE_VERSION_MAJOR}_${PREVIOUS_RELEASE_VERSION_MINOR}_maintenance")
5761
}
5862
}
5963
}
@@ -64,10 +68,22 @@ pipeline {
6468
githubAPI = load "JenkinsJobs/shared/githubAPI.groovy"
6569
githubAPI.setDryRun(params.DRY_RUN)
6670
}
67-
sh '''
68-
git submodule update --init --recursive
71+
sh '''#!/bin/bash -xe
72+
git submodule update --init --recursive --remote
6973
git config --global user.email '[email protected]'
7074
git config --global user.name 'Eclipse Releng Bot'
75+
76+
# Create maintenance branch (at RC) and checkout master (to allow switching branches)
77+
function createBranches() {
78+
git checkout -B master HEAD
79+
git fetch origin tag "${PREVIOUS_RELEASE_CANDIDATE_GIT_TAG}"
80+
git branch ${MAINTENANCE_BRANCH} ${PREVIOUS_RELEASE_CANDIDATE_GIT_TAG}
81+
git reflog show master
82+
git reflog show ${MAINTENANCE_BRANCH}
83+
}
84+
createBranches
85+
export -f createBranches
86+
git submodule foreach 'createBranches'
7187
'''
7288
}
7389
}
@@ -162,6 +178,40 @@ pipeline {
162178
'''
163179
}
164180
}
181+
stage('Prepare maintenance branch') {
182+
steps {
183+
// Apply all of the following changes at the maintenance branch
184+
sh 'git checkout ${MAINTENANCE_BRANCH}'
185+
186+
replaceInFile('JenkinsJobs/JobDSL.json', [
187+
"\"${PREVIOUS_RELEASE_VERSION}\": \"master\"" : "\"${PREVIOUS_RELEASE_VERSION}\": \"${MAINTENANCE_BRANCH}\"",
188+
])
189+
replaceInFile('JenkinsJobs/Builds/build.jenkinsfile', [
190+
"typeName: 'Integration' , branchLabel: 'master'" : "typeName: 'Integration' , branchLabel: '${MAINTENANCE_BRANCH}'",
191+
])
192+
replaceInFile('JenkinsJobs/Builds/DockerImagesBuild.jenkinsfile', [
193+
'-b master' : "-b ${MAINTENANCE_BRANCH}",
194+
])
195+
replaceAllInFile('JenkinsJobs/Builds/FOLDER.groovy', [
196+
"spec\\('''(?s).+?'''\\)" : "spec('')",
197+
])
198+
replaceInFile('cje-production/buildproperties.txt', [
199+
'BRANCH="master"' : "BRANCH=\"${MAINTENANCE_BRANCH}\"",
200+
])
201+
replaceInFile('cje-production/streams/repositories_java25.txt', [
202+
': master' : ": ${MAINTENANCE_BRANCH}",
203+
])
204+
replaceInFile('cje-production/streams/repositories_master.txt', [
205+
': master' : ": ${MAINTENANCE_BRANCH}",
206+
])
207+
sh "mv cje-production/streams/repositories_master.txt cje-production/streams/repositories_${MAINTENANCE_BRANCH}.txt"
208+
209+
commitAllChangesExcludingSubmodules("Move ${PREVIOUS_RELEASE_VERSION}-I builds to ${MAINTENANCE_BRANCH} branch")
210+
211+
// Switch back to master so that subsequent parts of this pipeline can continue to use HEAD
212+
sh 'git checkout master'
213+
}
214+
}
165215
stage('Validate and list changes') {
166216
steps {
167217
sh '''
@@ -171,6 +221,9 @@ pipeline {
171221
printLatestGitHistory
172222
export -f printLatestGitHistory
173223
git submodule foreach 'printLatestGitHistory'
224+
225+
echo 'Print history of maintenance branch'
226+
git log refs/tags/${PREVIOUS_RELEASE_CANDIDATE_GIT_TAG}..${MAINTENANCE_BRANCH} --patch-with-stat --summary
174227
'''
175228
// Run simple clean build to verify that at least all parent versions are updated correctly
176229
sh 'mvn clean'
@@ -258,6 +311,7 @@ pipeline {
258311
dryRunFlag='--dry-run'
259312
fi
260313
git push ${dryRunFlag} ${pushURL} HEAD:refs/heads/prepare_R${NEXT_RELEASE_VERSION}
314+
git push ${dryRunFlag} ${pushURL} "${MAINTENANCE_BRANCH}:refs/heads/${MAINTENANCE_BRANCH}"
261315
}
262316
pushNewCommitsToPreparationBranch
263317
export -f pushNewCommitsToPreparationBranch

RELEASE.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,6 @@ The release is scheduled for 10AM EST. Typically the jobs are scheduled beforeha
131131
- A script to create this issue exists [here](scripts/newReleasePrep.sh) for those who have the hub cli tool installed. The process has been in flux recently so please update the script if necessary, but it provides a helpful template since most tasks in the previous release's issue become links.
132132

133133
#### **Maintenance Branches:**
134-
* **Maintenance Branch Creation:**
135-
- Create the branch from RC2 using the [create maintenance branch](https://ci.eclipse.org/releng/job/Releng/job/createMaintenanceBranch/) job in the Eclipse Platform Releng Jenkins.
136134
* **Update maintenance branch with release version**
137135
- Once the I-build repo is removed for the previous release the maintenance branch will have to use the release location, i.e. any references to `https://download.eclipse.org/eclipse/updates/4.25-I-builds/` will need to be updated to `https://download.eclipse.org/eclipse/updates/4.26/R-4.26-202211231800/`
138136
- Functionally this means:

scripts/newReleasePrep.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,9 @@ TITLE="Preparation work for ${NEXT_STREAM} (${NEXT_TRAIN}) and open master for d
2424

2525
BODY="This preparation work involves the following tasks. For previous bug please refer to eclipse-platform/eclipse.platform.releng.aggregator#${PREV_ISSUE}.
2626
27-
- [ ] Create R${PREV_MAJOR}_${PREV_MINOR}_maintenance branch
28-
- [ ] Update R${PREV_MAJOR}_${PREV_MINOR}_maintenance branch with release version for ${PREV_MAJOR}.${PREV_MINOR}+ changes
2927
- [ ] Update JenkinsJobs for ${NEXT_STREAM}:
3028
- - [ ] Add ${NEXT_STREAM} to JobDSL.json to create new jobs
3129
- - [ ] Update "Brances" in JobDSL.json to move ${PREV_MAJOR}.${PREV_MINOR}-I builds to R${PREV_MAJOR}_${PREV_MINOR}_maintenance branch
32-
- - [ ] Add R${PREV_MAJOR}_${PREV_MINOR}_maintenance branch to parent pom and target sdk deployment jobs
3330
- - [ ] Update I-build triggers with dates for ${NEXT_STREAM} milestone
3431
- [ ] Splash Screen for ${NEXT_STREAM} (${NEXT_TRAIN})
3532
- [ ] Create ${NEXT_STREAM}-I-builds repo

0 commit comments

Comments
 (0)