diff --git a/registry-pull-heptapod-push-docker b/registry-pull-heptapod-push-docker index 11ab298f4aa5cce57f448c494b713d52f9e991d5_cmVnaXN0cnktcHVsbC1oZXB0YXBvZC1wdXNoLWRvY2tlcg==..cdf109f157f132e03d75e0b9b795253e3d71ddc8_cmVnaXN0cnktcHVsbC1oZXB0YXBvZC1wdXNoLWRvY2tlcg== 100755 --- a/registry-pull-heptapod-push-docker +++ b/registry-pull-heptapod-push-docker @@ -1,2 +1,4 @@ -#!/bin/sh +#!/usr/bin/env python3 +import argparse +import subprocess @@ -2,3 +4,5 @@ -TAG=testing +TAG="testing" +HEPTAPOD_REGISTRY_IMAGE="registry.heptapod.net:443/heptapod/omnibus-heptapod:" + TAG +TARGET_IMAGE="octobus/heptapod:" + TAG @@ -4,4 +8,8 @@ -HEPTAPOD_REGISTRY_IMAGE=registry.heptapod.net:443/heptapod/omnibus-heptapod:$TAG -TARGET_IMAGE=octobus/heptapod:$TAG +parser = argparse.ArgumentParser( + description="Pull Heptapod image from registry.h.n and tag it " + "for Docker Hub and the launch script" +) +parser.add_argument("--push", help="Push to Docker Hub", action="store_true") +cl_args = parser.parse_args() @@ -7,4 +15,5 @@ -docker pull $HEPTAPOD_REGISTRY_IMAGE -docker tag $HEPTAPOD_REGISTRY_IMAGE $TARGET_IMAGE -docker push $TARGET_IMAGE +subprocess.check_call(("docker", "pull", HEPTAPOD_REGISTRY_IMAGE)) +subprocess.check_call(("docker", "tag", HEPTAPOD_REGISTRY_IMAGE, TARGET_IMAGE)) +if cl_args.push: + subprocess.check_call(("docker", "push", TARGET_IMAGE))