|
1 | 1 |
|
| 2 | +def releaseEvents = [ M1: 'Milestone 1', M2: 'Milestone 2', M3: 'Milestone 3', RC1: 'Release Candidate 1', RC2: 'Release Candidate 2', GA: 'Release' ] |
| 3 | + |
2 | 4 | pipeline { |
3 | 5 | options { |
4 | 6 | timestamps() |
@@ -55,25 +57,28 @@ pipeline { |
55 | 57 | assignEnvVariable('PREVIOUS_RELEASE_CANDIDATE_I_BUILD', "I${previousIdMatcher.group('date')}-${previousIdMatcher.group('time')}") |
56 | 58 | previousIdMatcher = null // release matcher as it's not serializable |
57 | 59 |
|
58 | | - //TODO: Read the dates from the calender instead of provide a structured document somewhere? |
59 | | - // E.g. next to: https://github.com/eclipse-simrel/.github/blob/main/wiki/SimRel/2025-09.md |
60 | | - def m1Date = parseDate(readParameter('M1_DATE')) |
61 | | - def m2Date = parseDate(readParameter('M2_DATE')) |
62 | | - def m3Date = parseDate(readParameter('M3_DATE')) |
63 | | - def rc1Date = parseDate(readParameter('RC1_DATE')) |
64 | | - def rc2Date = parseDate(readParameter('RC2_DATE')) |
65 | | - def gaDate = parseDate(readParameter('GA_DATE')) |
66 | | - if (!(m1Date < m2Date && m2Date < m3Date && m3Date < rc1Date && rc1Date < rc2Date && rc2Date < gaDate)) { |
67 | | - error "Dates are not in strictly ascending order: ${M1_DATE}, ${M2_DATE}, ${M3_DATE}, ${RC1_DATE}, ${RC2_DATE}, ${GA_DATE}" |
| 60 | + env.NEXT_SIMREL_NAME = readParameter('NEXT_SIMREL_NAME') |
| 61 | + def simRelMatcher = env.NEXT_SIMREL_NAME =~ /(?<year>\d{4})-(?<month>\d{2})/ |
| 62 | + if (!simRelMatcher.matches()) { |
| 63 | + error "Unexpected format for NEXT_SIMREL_NAME: ${NEXT_SIMREL_NAME}" |
| 64 | + } |
| 65 | + assignEnvVariable('NEXT_RELEASE_YEAR', simRelMatcher.group('year')) |
| 66 | + assignEnvVariable('NEXT_RELEASE_MONTH', simRelMatcher.group('month')) |
| 67 | + assignEnvVariable('NEXT_RELEASE_NAME', "${NEXT_SIMREL_NAME}") |
| 68 | + simRelMatcher = null // release matcher as it's not serializable |
| 69 | + |
| 70 | + def simRelDatesRaw = sh(script: "curl --fail https://raw.githubusercontent.com/eclipse-simrel/.github/refs/heads/main/wiki/SimRel/${NEXT_SIMREL_NAME}_dates.json", returnStdout: true) |
| 71 | + def simRelDates = readJSON(text: simRelDatesRaw) |
| 72 | + def eclipseReleaseDates = releaseEvents.collectEntries{ name, _ -> |
| 73 | + def date = parseDate(simRelDates[name]).minusDays(name == 'GA' ? 0 : 7) // All Eclipse-TLPs have offset -7 days |
| 74 | + assignEnvVariable("${name}_DATE", date) |
| 75 | + return [name, date] |
68 | 76 | } |
69 | | - assignEnvVariable('NEXT_RELEASE_YEAR', gaDate.year.toString()) |
70 | | - assignEnvVariable('NEXT_RELEASE_MONTH', String.format("%02d", gaDate.monthValue)) |
71 | | - assignEnvVariable('NEXT_RELEASE_NAME', "${NEXT_RELEASE_YEAR}-${NEXT_RELEASE_MONTH}") |
72 | 77 | assignEnvVariable('MAINTENANCE_BRANCH', "R${PREVIOUS_RELEASE_VERSION_MAJOR}_${PREVIOUS_RELEASE_VERSION_MINOR}_maintenance") |
73 | 78 |
|
74 | 79 | // Compute new build schedule |
75 | 80 | def now = java.time.LocalDate.now() |
76 | | - def rcEnd = rc2Date.minusDays(2) // Wednesday before RC2 is the last planned I-build and the cron-triggers should stop after |
| 81 | + def rcEnd = eclipseReleaseDates.RC2.minusDays(2) // Wednesday before RC2 is the last planned I-build and the cron-triggers should stop after |
77 | 82 | assignEnvVariable('I_BUILD_SCHEDULE', createCronPattern(now, rcEnd, 18, '*').trim()) |
78 | 83 |
|
79 | 84 | env.NEXT_JAVA_RELEASE_DATE = readParameter('NEXT_JAVA_RELEASE_DATE') |
@@ -445,12 +450,10 @@ pipeline { |
445 | 450 | echo "Skipping .eclipsefdn repository of : ${organisation}" |
446 | 451 | continue |
447 | 452 | } |
448 | | - githubAPI.createMilestone(organisation, repository, "${NEXT_RELEASE_VERSION} M1", "${NEXT_RELEASE_VERSION} Milestone 1", "${M1_DATE}") |
449 | | - githubAPI.createMilestone(organisation, repository, "${NEXT_RELEASE_VERSION} M2", "${NEXT_RELEASE_VERSION} Milestone 2", "${M2_DATE}") |
450 | | - githubAPI.createMilestone(organisation, repository, "${NEXT_RELEASE_VERSION} M3", "${NEXT_RELEASE_VERSION} Milestone 3", "${M3_DATE}") |
451 | | - githubAPI.createMilestone(organisation, repository, "${NEXT_RELEASE_VERSION} RC1", "${NEXT_RELEASE_VERSION} Release Candidate 1", "${RC1_DATE}") |
452 | | - githubAPI.createMilestone(organisation, repository, "${NEXT_RELEASE_VERSION} RC2", "${NEXT_RELEASE_VERSION} Release Candidate 2", "${RC2_DATE}") |
453 | | - githubAPI.createMilestone(organisation, repository, "${NEXT_RELEASE_VERSION}", "${NEXT_RELEASE_VERSION} Release", "${GA_DATE}") |
| 453 | + releaseEvents.each{ name, description -> |
| 454 | + def title = "${NEXT_RELEASE_VERSION}" + (name != 'GA' ? " ${name}" : '') |
| 455 | + githubAPI.createMilestone(organisation, repository, title, "${NEXT_RELEASE_VERSION} ${description}", env["${name}_DATE"]) |
| 456 | + } |
454 | 457 | } |
455 | 458 | } |
456 | 459 | } |
|
0 commit comments