From d24b522ce16998a85d99bc20bd4afa3a2719e0e9 Mon Sep 17 00:00:00 2001 From: Daniel Beck Date: Thu, 28 Jul 2022 13:00:53 +0200 Subject: [PATCH] More quickly pick up new LTS releases --- content/_layouts/corebaseline.html.haml | 7 +++++-- scripts/fetch-external-resources | 6 ++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/content/_layouts/corebaseline.html.haml b/content/_layouts/corebaseline.html.haml index 726f428e8d2b..d60fe339a319 100644 --- a/content/_layouts/corebaseline.html.haml +++ b/content/_layouts/corebaseline.html.haml @@ -12,8 +12,11 @@ layout: developersection lts = site._generated[:core_tiers].stableCores oldest_lts = lts[0] + all_lts = site._generated[:lts_releases].results.map { |v| v.version } - next_lts_1 = lts.select { |v| v =~ /[.]1$/ }[-1] - previous_lts_highs = lts.map { |v| v[0...-1] }.uniq[0...-1].map { |l| lts.select { |v| v.start_with?(l) }[-1] } + next_lts_1 = all_lts.select { |v| v =~ /[.]1$/ }[0] + # We assume that lts will contain at least one release of the previous LTS line, which is reasonable. + # Surely there's going to be at least one plugin depending on the old .1 by the time the next .1 is available. + previous_lts_highs = lts.map { |v| v[0...-1] }.uniq[0...-1].map { |l| all_lts.select { |v| v.start_with?(l) }[0] } = page.content.gsub('PLACEHOLDER_NEWER_LTS_POINT_ONE', next_lts_1).gsub('PLACEHOLDER_RECENT_LTS_POINT_HIGHS', previous_lts_highs[-2...].join(' and ')).gsub('PLACEHOLDER_OLDER_LTS_POINT_HIGHS', previous_lts_highs[0...-2].join(' and ')).gsub('PLACEHOLDER_OLDEST_LTS', oldest_lts).gsub('PLACEHOLDER_OLDEST_WEEKLY', oldest_weekly).gsub('PLACEHOLDER_LATEST_SPLIT', latest_split) diff --git a/scripts/fetch-external-resources b/scripts/fetch-external-resources index 5e31ad10b9ae..5794e3190b3e 100755 --- a/scripts/fetch-external-resources +++ b/scripts/fetch-external-resources @@ -44,6 +44,12 @@ RESOURCES = [ nil, nil ], + [ + 'https://repo.jenkins-ci.org/api/search/versions?g=org.jenkins-ci.main&a=jenkins-core&repos=releases&v=?.*.?', + 'content/_data/_generated/lts_releases.yml', + nil, + nil + ], [ 'https://updates.jenkins.io/update-center.actual.json', 'content/_data/_generated/update_center.yml',