Commit 6c41c303 authored by Noé Gaumont's avatar Noé Gaumont 🐙

feat: tag and push minor version

this will tag buster-3.26.22 as 3.26.22
parent 672a36657e27
......@@ -40,6 +40,12 @@ class CubicWebImage:
return f"{REGISTRY}:dev"
return f"{REGISTRY}:{self.debian_dist}-{self.cubicweb_version}"
@property
def minor_tag(self):
if self.is_dev():
return f"{REGISTRY}:dev"
return f"{REGISTRY}:{self.cubicweb_version}"
@property
def major_tag(self):
if self.is_dev():
......@@ -130,6 +136,12 @@ def tag_aliases(images: List[CubicWebImage], last_debian_dist: str):
res = run("docker", "tag", src, img.major_tag)
conditionnal_append(tags, fail_tags, res.returncode == 0, img.major_tag)
# tag {last_debian_dist}-3.26.22 as 3.26.22
for img in images:
if img.debian_dist == last_debian_dist:
res = run("docker", "tag", img.tag, img.minor_tag)
conditionnal_append(tags, fail_tags, res.returncode == 0, img.minor_tag)
res = run(
"docker",
"tag",
......@@ -240,7 +252,8 @@ def push(images: List[CubicWebImage], last_debian_dist: str):
succeed_push = []
fail_push = []
minor_tags = (image.tag for image in images)
minor_tags = (image.minor_tag for image in images)
minor_tags_with_debian = (image.tag for image in images)
def major_tags_gen():
for major, img in latest.items():
......@@ -253,7 +266,9 @@ def push(images: List[CubicWebImage], last_debian_dist: str):
f"{REGISTRY}:buildpackage",
)
for tag in itertools.chain(minor_tags, major_tags_gen(), buildpackage_tags):
for tag in itertools.chain(
minor_tags, minor_tags_with_debian, major_tags_gen(), buildpackage_tags
):
res = run(
"docker",
"push",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment