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