Skip testing TPs/betas for now

Signed-off-by: Joffrey F <joffrey@docker.com>
This commit is contained in:
Joffrey F 2018-08-31 16:58:30 -07:00
parent bdd2c80d98
commit d491a81cec
1 changed files with 21 additions and 17 deletions

View File

@ -37,22 +37,22 @@ import requests
GITHUB_API = 'https://api.github.com/repos' GITHUB_API = 'https://api.github.com/repos'
class Version(namedtuple('_Version', 'major minor patch rc edition')): class Version(namedtuple('_Version', 'major minor patch stage edition')):
@classmethod @classmethod
def parse(cls, version): def parse(cls, version):
edition = None edition = None
version = version.lstrip('v') version = version.lstrip('v')
version, _, rc = version.partition('-') version, _, stage = version.partition('-')
if rc: if stage:
if 'rc' not in rc: if not any(marker in stage for marker in ['rc', 'tp', 'beta']):
edition = rc edition = stage
rc = None stage = None
elif '-' in rc: elif '-' in stage:
edition, rc = rc.split('-') edition, stage = stage.split('-')
major, minor, patch = version.split('.', 3) major, minor, patch = version.split('.', 3)
return cls(major, minor, patch, rc, edition) return cls(major, minor, patch, stage, edition)
@property @property
def major_minor(self): def major_minor(self):
@ -64,13 +64,13 @@ class Version(namedtuple('_Version', 'major minor patch rc edition')):
correctly with the default comparator. correctly with the default comparator.
""" """
# rc releases should appear before official releases # rc releases should appear before official releases
rc = (0, self.rc) if self.rc else (1, ) stage = (0, self.stage) if self.stage else (1, )
return (int(self.major), int(self.minor), int(self.patch)) + rc return (int(self.major), int(self.minor), int(self.patch)) + stage
def __str__(self): def __str__(self):
rc = '-{}'.format(self.rc) if self.rc else '' stage = '-{}'.format(self.stage) if self.stage else ''
edition = '-{}'.format(self.edition) if self.edition else '' edition = '-{}'.format(self.edition) if self.edition else ''
return '.'.join(map(str, self[:3])) + edition + rc return '.'.join(map(str, self[:3])) + edition + stage
BLACKLIST = [ # List of versions known to be broken and should not be used BLACKLIST = [ # List of versions known to be broken and should not be used
@ -113,9 +113,9 @@ def get_latest_versions(versions, num=1):
def get_default(versions): def get_default(versions):
"""Return a :class:`Version` for the latest non-rc version.""" """Return a :class:`Version` for the latest GA version."""
for version in versions: for version in versions:
if not version.rc: if not version.stage:
return version return version
@ -123,8 +123,12 @@ def get_versions(tags):
for tag in tags: for tag in tags:
try: try:
v = Version.parse(tag['name']) v = Version.parse(tag['name'])
if v not in BLACKLIST: if v in BLACKLIST:
yield v continue
# FIXME: Temporary. Remove once these versions are built on dockerswarm/dind
if v.stage and 'rc' not in v.stage:
continue
yield v
except ValueError: except ValueError:
print("Skipping invalid tag: {name}".format(**tag), file=sys.stderr) print("Skipping invalid tag: {name}".format(**tag), file=sys.stderr)