Skip to content
Snippets Groups Projects
Commit cb0fc08e2e3e authored by Georges Racinet's avatar Georges Racinet :squid:
Browse files

push-release: still pushing to octobus/heptapod

At this point the testing image will be pushed to `heptapod/heptapod` only,
but we still push the other tags, e.g., `1.3.0`, `1-3-latest` to the previously
used `octobus/heptapod`
parent b0dce2893569
No related branches found
No related tags found
No related merge requests found
Pipeline #79233 passed
......@@ -9,6 +9,7 @@
logger = logging.getLogger(os.path.basename(__file__).rsplit('.', 1)[0])
OCTOBUS_BASE_IMAGE = 'octobus/heptapod'
BASE_IMAGE = 'heptapod/heptapod'
GITLAB_RAILS = '/opt/gitlab/embedded/service/gitlab-rails/'
......@@ -31,5 +32,5 @@
self.podman = podman
self.docker_cmd = 'podman' if podman else 'docker'
def docker_hub_base_image(self):
def docker_hub_base_image(self, base_image):
if self.podman:
......@@ -35,6 +36,6 @@
if self.podman:
return 'docker.io/' + BASE_IMAGE
return BASE_IMAGE
return 'docker.io/' + base_image
return base_image
def docker(self, *args, **kwargs):
cmd = [self.docker_cmd]
......@@ -45,6 +46,6 @@
return self.image_tag('testing',
stable_series=stable_series)
def image_tag(self, label, stable_series=None):
def image_tag(self, label, stable_series=None, base_image=BASE_IMAGE):
if stable_series is not None:
label = '-'.join((stable_series, label))
......@@ -49,6 +50,6 @@
if stable_series is not None:
label = '-'.join((stable_series, label))
return ':'.join((self.docker_hub_base_image(), label))
return ':'.join((self.docker_hub_base_image(base_image), label))
def read_check_version(self, stable_series, validate_build_number=True):
"""Read version files and check consistency."""
......@@ -77,11 +78,16 @@
return archival, version, build_number
def push_tag(self, label, stable_series=None, tag_series=None):
img_tag = self.image_tag(label, stable_series=tag_series)
self.docker('tag', self.testing_img(stable_series), img_tag,
simulate=self.simulate)
self.docker('push', img_tag, simulate=self.simulate)
def push_tag(self, label,
stable_series=None,
tag_series=None,
):
for base_image in (OCTOBUS_BASE_IMAGE, BASE_IMAGE):
img_tag = self.image_tag(label, stable_series=tag_series,
base_image=base_image)
self.docker('tag', self.testing_img(stable_series), img_tag,
simulate=self.simulate)
self.docker('push', img_tag, simulate=self.simulate)
def series(s):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment