Skip to content

Commit

Permalink
Update release tuesday calculation to be 3rd teusday of month (#1173)
Browse files Browse the repository at this point in the history
* Update release tuesday calculation to be 3rd teusday of month

Signed-off-by: Andrew Leonard <[email protected]>

* Update release tuesday calculation to be 3rd tuesday of month

Signed-off-by: Andrew Leonard <[email protected]>

* Update release tuesday calculation to be 3rd tuesday of month

Signed-off-by: Andrew Leonard <[email protected]>

---------

Signed-off-by: Andrew Leonard <[email protected]>
  • Loading branch information
andrew-m-leonard authored Jan 2, 2025
1 parent 83e9bc8 commit 72d61d5
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions pipelines/build/common/trigger_beta_build.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ def publishJobTag

// Is the current day within the release period of from the previous Saturday to the following Sunday
// from the release Tuesday ?
// Release Tuesday is now the 3rd Tuesday of the month
def isDuringReleasePeriod() {
def releasePeriod = false
def now = ZonedDateTime.now(ZoneId.of('UTC'))
Expand All @@ -58,23 +59,22 @@ def isDuringReleasePeriod() {
// Is it a release month? CPU updates in Jan, Apr, Jul, Oct
// New major versions are released in Mar and Sept
if (month == Month.JANUARY || month == Month.MARCH || month == Month.APRIL || month == Month.JULY || month == Month.SEPTEMBER || month == Month.OCTOBER) {
// Yes, calculate release Tuesday, which is the closest Tuesday to the 17th
def day17th = now.withDayOfMonth(17)
def dayOfWeek17th = day17th.getDayOfWeek()
def releaseTuesday
if (dayOfWeek17th == DayOfWeek.SATURDAY || dayOfWeek17th == DayOfWeek.SUNDAY || dayOfWeek17th == DayOfWeek.MONDAY || dayOfWeek17th == DayOfWeek.TUESDAY) {
releaseTuesday = day17th.with(TemporalAdjusters.nextOrSame(DayOfWeek.TUESDAY))
} else {
releaseTuesday = day17th.with(TemporalAdjusters.previous(DayOfWeek.TUESDAY))
}
// Yes, calculate release Tuesday, which is the 3rd Tuesday of the month
def day1st = now.withDayOfMonth(1)
def releaseTuesday = day1st.with(TemporalAdjusters.dayOfWeekInMonth(3, DayOfWeek.TUESDAY))
echo "Release Tuesday for this month is: "+releaseTuesday

// Release period no trigger from prior week previous Saturday to following Sunday
def days = ChronoUnit.DAYS.between(releaseTuesday, now)
if (days >= -10 && days <= 5) {
releasePeriod = true
}
} else {
echo "No releases this month"
}

echo "Is within release period? "+releasePeriod

return releasePeriod
}

Expand Down Expand Up @@ -189,7 +189,7 @@ node('worker') {
def binariesRepoTag = publishJobTag + "-beta"

if (isDuringReleasePeriod()) {
echo "We are within a release period (previous Saturday to the following Sunday around the release Tuesday), so testing is disabled."
echo "We are within a release period (prior week previous Saturday to the following Sunday around the release Tuesday), so testing is disabled."
enableTesting = false
}

Expand Down

0 comments on commit 72d61d5

Please sign in to comment.