Get releases from Docker Hub

This commit is contained in:
Nemo
2022-05-24 17:00:40 +05:30
parent 69afee15a2
commit dd4d932fc7
5 changed files with 184 additions and 1 deletions

View File

@@ -1,2 +1,85 @@
{
"2022.0.20220504.1": "2022-05-12",
"2018.03.0.20220503.0": "2022-05-12",
"2.0.20220426.0": "2022-05-03",
"2022.0.20220419.0": "2022-05-02",
"2018.03.0.20220419.0": "2022-04-23",
"2.0.20220419.0": "2022-04-21",
"2.0.20220406.1": "2022-04-13",
"2022.0.20220315.0": "2022-03-30",
"2018.03.0.20220315.0": "2022-03-19",
"2022.0.20220308.1": "2022-03-18",
"2.0.20220316.0": "2022-03-18",
"2.0.20220218.1": "2022-03-04",
"2018.03.0.20220209.0": "2022-02-28",
"2022.0.20220202.0": "2022-02-08",
"2.0.20220121.0": "2022-02-04",
"2018.03.0.20220119.1": "2022-01-27",
"2.0.20211223.0": "2022-01-12",
"2018.03.0.20211201.0": "2021-12-02",
"2.0.20211201.0": "2021-12-02",
"2018.03.0.20211015.1": "2021-11-10",
"2.0.20211005.0": "2021-10-21",
"2.0.20211001.0": "2021-10-01",
"2018.03.0.20211001.0": "2021-10-01",
"2.0.20210813.1": "2021-09-09",
"2.0.20210721.2": "2021-08-02",
"2018.03.0.20210721.0": "2021-08-02",
"2.0.20210701.0": "2021-07-16",
"2.0.20210617.0": "2021-06-25",
"2.0.20210525.0": "2021-06-14",
"2018.03.0.20210521.1": "2021-06-04",
"2.0.20210421.0": "2021-06-03",
"2018.03.0.20210408.0": "2021-04-29",
"2018.03.0.20210319.0": "2021-03-30",
"2.0.20210326.0": "2021-03-30",
"2.0.20210219.0": "2021-02-24",
"2.0.20210126.0": "2021-01-27",
"2018.03.0.20210126.1": "2021-01-27",
"2018.03.0.20201209.1": "2020-12-23",
"2.0.20201218.1": "2020-12-23",
"2018.03.0.20201028.0": "2020-12-18",
"2.0.20201111.0": "2020-12-18",
"2.0.20200722.0": "2020-07-31",
"2.0.20200602.0": "2020-06-30",
"2018.03.0.20200602.1": "2020-06-30",
"2.0.20200406.0": "2020-04-21",
"2018.03.0.20200318.1": "2020-04-01",
"2.0.20200304.0": "2020-04-01",
"2.0.20200207.1": "2020-02-20",
"2018.03.0.20191219.0": "2020-01-16",
"2.0.20191217.0": "2020-01-10",
"2018.03.0.20191014.0": "2019-10-22",
"2.0.20191016.0": "2019-10-22",
"2018.03.0.20190826": "2019-09-06",
"2.0.20190823.1": "2019-09-06",
"2018.03.0.20190514": "2019-05-23",
"2.0.20190508": "2019-05-23",
"2018.03.0.20190212": "2019-05-10",
"2.0.20190228": "2019-05-10",
"2.0.20190218": "2019-02-26",
"2.0.20190212": "2019-02-13",
"2.0.20190207": "2019-02-08",
"2018.03.0.20190207": "2019-02-08",
"2.0.20190115": "2019-01-22",
"2018.03.0.20190118": "2019-01-21",
"2.0.20181114": "2018-11-27",
"2.0.20181010": "2018-10-18",
"2.0.20180827": "2018-10-18",
"2018.03.0.20180827": "2018-08-30",
"2018.03.0.20180622": "2018-06-26",
"2.0.20180622.1": "2018-06-26",
"2018.03.0.20180424": "2018-04-25",
"2017.09.1.20180409": "2018-04-10",
"2017.12.0.20180330": "2018-04-10",
"2017.09.1.20180222": "2018-02-26",
"2017.12.0.20180222": "2018-02-26",
"2017.12.0.20171212.2": "2017-12-13",
"2016.09.1.20161221": "2017-11-03",
"2017.03.1.20170812": "2017-11-03",
"2017.09.0.20170930": "2017-11-03",
"2017.03.0.20170812": "2017-09-13",
"2017.03.0.20170401": "2017-04-07",
"2016.09.0.20161118": "2016-11-22",
"2016.09.0.20161028": "2016-11-16"
}

View File

@@ -1,2 +1,46 @@
{
"7.1.0": "2022-05-05",
"7.0.3": "2022-04-30",
"6.5.2": "2022-04-30",
"6.0.5": "2022-04-30",
"6.6.5": "2022-02-02",
"6.6.4": "2022-01-07",
"7.0.2": "2021-10-16",
"6.6.3": "2021-10-16",
"7.0.1": "2021-10-01",
"7.0.0": "2021-08-31",
"6.6.2": "2021-07-26",
"6.6.1": "2021-07-26",
"6.6.0": "2021-07-26",
"6.5.1": "2021-07-26",
"6.5.0": "2021-07-26",
"6.0.4": "2021-07-26",
"6.0.3": "2021-07-26",
"6.0.2": "2021-07-26",
"6.0.1": "2021-07-26",
"6.0.0": "2019-01-23",
"4.6.5": "2018-10-19",
"5.5.2": "2018-10-19",
"5.5.1": "2018-09-06",
"5.5.0": "2018-07-26",
"5.1.1": "2018-07-17",
"4.6.4": "2018-04-28",
"5.1.0": "2018-04-28",
"5.0.1": "2018-01-25",
"4.6.3": "2017-11-18",
"3.1.6": "2017-08-10",
"4.6.2": "2017-08-10",
"4.6.1": "2017-05-15",
"4.6.0": "2017-03-01",
"4.5.1": "2017-01-21",
"4.5.0": "2016-09-26",
"3.1.5": "2016-07-22",
"4.1.1": "2016-06-01",
"2.5.2": "2016-05-06",
"3.0.2": "2016-05-06",
"3.0.3": "2016-05-06",
"3.1.0": "2016-05-06",
"3.1.3": "2016-05-06",
"4.0.0": "2016-05-06",
"4.1.0": "2016-05-06"
}

View File

@@ -1,2 +1,20 @@
{
"36": "2022-05-13",
"37": "2022-05-12",
"35": "2022-03-20",
"34": "2022-03-20",
"33": "2021-11-29",
"32": "2021-07-23",
"31": "2021-04-01",
"30": "2020-02-21",
"29": "2019-06-05",
"28": "2019-06-05",
"27": "2019-06-05",
"26": "2019-06-05",
"25": "2017-12-28",
"24": "2017-09-13",
"20": "2017-03-15",
"21": "2017-03-15",
"22": "2017-03-15",
"23": "2017-03-15"
}

View File

@@ -1,2 +1,20 @@
{
"3.4.4": "2022-03-31",
"3.4.2": "2021-12-27",
"3.4.1": "2021-12-19",
"3.4": "2021-12-13",
"3.3.4": "2021-10-07",
"3.3.3": "2021-08-19",
"3.3.2": "2021-05-25",
"3.3.1": "2021-05-21",
"3.3": "2021-04-21",
"3.2.3": "2020-11-15",
"3.2.1": "2020-10-22",
"3.2.2": "2020-10-22",
"3.2": "2020-04-26",
"3.1.2": "2020-01-17",
"3.1.1": "2019-04-28",
"3.1": "2019-03-14",
"3.0.6": "2018-10-25",
"3.0.2": "2018-10-24"
}

View File

@@ -5,6 +5,8 @@ require 'json'
require 'rugged'
require 'liquid'
require 'digest'
require 'net/http'
require 'uri'
WEBSITE_DIR = ARGV[0]
CACHE_DIR = ARGV[1]
@@ -101,12 +103,30 @@ def generate_commit_message
end
end
def get_releases_from_dockerhub(config)
url = "https://hub.docker.com/v2/repositories/#{config['dockerhub']}/tags?page_size=100&page=1"
ret = {}
loop do
data = JSON.parse Net::HTTP.get(URI.parse(url))
data['results'].each do |r|
next unless good_tag(r['name'], config)
tag_proper_name = render_tag(r['name'], config)
ret[tag_proper_name] = r['tag_last_pushed'][0..9]
end
url = data['next']
break if url.nil?
end
ret
end
def get_releases(product, config, i)
type = get_update_type(config)
if type == 'git'
dir = get_cache_dir('git', product, config)
fetch_git_releases(dir, config)
return get_releases_from_git(dir, config)
elsif type == 'dockerhub'
return get_releases_from_dockerhub(config)
else
puts "Not implemented: #{type}"
return {}
@@ -114,7 +134,7 @@ def get_releases(product, config, i)
end
def get_update_type(config)
for i in ['git', 'oci', 'npm']
for i in ['git', 'oci', 'npm', 'dockerhub']
return i if config[i]
end
end