Skip to content

Commit 9f10999

Browse files
committed
[RelEng] Move previous release's I-build job to maintenance branch
when preparing a new dev cycle. This used to be done in the past but was forgotten or just stopped to be done and was then done manually. On the master keep the old and new job until the old job is finally removed when the release is promoted.
1 parent b3875f2 commit 9f10999

File tree

8 files changed

+34
-21
lines changed

8 files changed

+34
-21
lines changed

JenkinsJobs/AutomatedTests/I_unit_tests.groovy

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
def config = new groovy.json.JsonSlurper().parseText(readFileFromWorkspace('JenkinsJobs/JobDSL.json'))
2-
def STREAMS = config.Streams
32

43
def TEST_CONFIGURATIONS = [
54
[os: 'linux' , ws:'gtk' , arch: 'x86_64' , javaVersion: 21, agentLabel: 'ubuntu-2404' , javaHome: "tool(type:'jdk', name:'temurin-jdk21-latest')" ],
@@ -10,7 +9,7 @@ def TEST_CONFIGURATIONS = [
109
[os: 'win32' , ws:'win32', arch: 'x86_64' , javaVersion: 21, agentLabel: 'qa6xd-win11' , javaHome: "'C:\\\\Program Files\\\\Eclipse Adoptium\\\\jdk-21.0.5.11-hotspot'" ],
1110
]
1211

13-
for (STREAM in STREAMS){
12+
for (STREAM in config.Branches.keySet()){
1413
def MAJOR = STREAM.split('\\.')[0]
1514
def MINOR = STREAM.split('\\.')[1]
1615
for (TEST_CONFIG in TEST_CONFIGURATIONS){

JenkinsJobs/Builds/FOLDER.groovy

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ folder('Builds') {
44
description('Eclipse periodic build jobs.')
55
}
66

7-
for (STREAM in config.Streams){
8-
def BRANCH = config.Branches[STREAM]
7+
for (entry in config.Branches.entrySet()){
8+
def STREAM = entry.key
9+
def BRANCH = entry.value
910

1011
pipelineJob('Builds/I-build-' + STREAM){
1112
description('Daily Eclipse Integration builds.')

JenkinsJobs/JobDSL.json

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
{
2-
"Streams": [
3-
"4.38"
4-
],
5-
"Branches": {
6-
"4.38": "master"
7-
}
8-
}
2+
"Branches": {
3+
"4.38": "master"
4+
}
5+
}

JenkinsJobs/Releng/prepareNextDevCycle.jenkinsfile

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,12 @@ pipeline {
156156
replaceInFile('production/testScripts/configuration/streamSpecific.properties', [
157157
"for ${PREVIOUS_RELEASE_VERSION}.0 builds" : "for ${NEXT_RELEASE_VERSION}.0 builds",
158158
])
159-
replaceInFile('JenkinsJobs/JobDSL.json', [
160-
/"${PREVIOUS_RELEASE_VERSION}"/ : /"${NEXT_RELEASE_VERSION}"/,
161-
])
159+
script {
160+
utilities.modifyJSON('JenkinsJobs/JobDSL.json') { jobs ->
161+
jobs.Branches["${PREVIOUS_RELEASE_VERSION}"] = env.MAINTENANCE_BRANCH
162+
jobs.Branches["${NEXT_RELEASE_VERSION}"] = 'master'
163+
}
164+
}
162165
replaceAllInFile('JenkinsJobs/Builds/FOLDER.groovy', [
163166
"(?<prefix># Schedule:.*\\R)(?s).*(?<suffix>\\R'''\\))" : "\${prefix}${I_BUILD_SCHEDULE}\${suffix}",
164167
])
@@ -228,9 +231,11 @@ pipeline {
228231
// Apply the following changes at a preparation branch, starting at the maintenance branch (to create a PR later)
229232
sh 'git checkout -b prepareMaintenance ${MAINTENANCE_BRANCH}'
230233

231-
replaceInFile('JenkinsJobs/JobDSL.json', [
232-
"\"${PREVIOUS_RELEASE_VERSION}\": \"master\"" : "\"${PREVIOUS_RELEASE_VERSION}\": \"${MAINTENANCE_BRANCH}\"",
233-
])
234+
script {
235+
utilities.modifyJSON('JenkinsJobs/JobDSL.json') { jobs ->
236+
jobs.Branches["${PREVIOUS_RELEASE_VERSION}"] = env.MAINTENANCE_BRANCH
237+
}
238+
}
234239
replaceInFile('JenkinsJobs/Builds/build.jenkinsfile', [
235240
"typeName: 'Integration' , branchLabel: 'master'" : "typeName: 'Integration' , branchLabel: '${MAINTENANCE_BRANCH}'",
236241
])

JenkinsJobs/Releng/promoteBuild.jenkinsfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,9 @@ pipeline {
218218
'previousReleaseVersion=.*' : "previousReleaseVersion=${BUILD_MAJOR}.${BUILD_MINOR}",
219219
'previousReleaseVersionRepo=.*' : "previousReleaseVersionRepo=${BUILD_MAJOR}.${BUILD_MINOR}",
220220
])
221+
utilities.modifyJSON('JenkinsJobs/JobDSL.json') { jobs -> // Remove old I-build job for this release
222+
jobs.Branches.remove("${BUILD_MAJOR}.${BUILD_MINOR}")
223+
}
221224

222225
utilities.gitCommitAllExcludingSubmodules("Update previous release version to ${BUILD_MAJOR}.${BUILD_MINOR} GA across build scripts")
223226
}

JenkinsJobs/YBuilds/FOLDER.groovy

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ folder('YPBuilds') {
55
description('Builds and tests for the beta java builds.')
66
}
77

8-
for (STREAM in config.Streams){
9-
def BRANCH = config.Branches[STREAM]
8+
for (entry in config.Branches.entrySet()){
9+
def STREAM = entry.key
10+
def BRANCH = entry.value
1011

1112
pipelineJob('YPBuilds/Y-build-' + STREAM){
1213
description('Daily Maintenance Builds.')

JenkinsJobs/YBuilds/Y_unit_tests.groovy

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
def config = new groovy.json.JsonSlurper().parseText(readFileFromWorkspace('JenkinsJobs/JobDSL.json'))
2-
def STREAMS = config.Streams
32

43
def TEST_CONFIGURATIONS = [
54
[os: 'linux' , ws:'gtk' , arch: 'x86_64' , javaVersion: 21, agentLabel: 'ubuntu-2404' , javaHome: "tool(type:'jdk', name:'temurin-jdk21-latest')" ],
@@ -9,7 +8,7 @@ def TEST_CONFIGURATIONS = [
98
[os: 'win32' , ws:'win32', arch: 'x86_64' , javaVersion: 21, agentLabel: 'qa6xd-win11' , javaHome: "'C:\\\\Program Files\\\\Eclipse Adoptium\\\\jdk-21.0.5.11-hotspot'" ],
109
]
1110

12-
for (STREAM in STREAMS){
11+
for (STREAM in config.Branches.keySet()){
1312
def MAJOR = STREAM.split('\\.')[0]
1413
def MINOR = STREAM.split('\\.')[1]
1514
for (TEST_CONFIG in TEST_CONFIGURATIONS){

JenkinsJobs/shared/utilities.groovy

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import groovy.json.JsonOutput
12

23
@groovy.transform.Field
34
def boolean IS_DRY_RUN = true
@@ -22,6 +23,13 @@ def replaceAllInFile(String filePath, Map<String,String> replacements) {
2223
writeFile(file:filePath, text: content)
2324
}
2425

26+
def modifyJSON(String jsonFilePath, Closure transformation) {
27+
def json = readJSON(file: jsonFilePath)
28+
transformation.call(json)
29+
// This leads to prettier results than using the writeJSON() step, even with the pretty parameter set.
30+
writeFile(file: jsonFilePath, text: JsonOutput.prettyPrint(JsonOutput.toJson(json)), encoding :'UTF-8')
31+
}
32+
2533
def runHereAndForEachGitSubmodule(Closure task) {
2634
task.call()
2735
forEachGitSubmodule(task)

0 commit comments

Comments
 (0)