From 0265033e2621f50375e4d4099206664a9c25e34d Mon Sep 17 00:00:00 2001 From: Tamas Gal <tgal@km3net.de> Date: Sun, 1 Mar 2020 12:02:34 +0100 Subject: [PATCH] Add option to skip pushing --- publish_images.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/publish_images.py b/publish_images.py index 5a8107e..bf8d27c 100755 --- a/publish_images.py +++ b/publish_images.py @@ -5,6 +5,7 @@ import sys import time REGISTRY_URL = 'docker.km3net.de' +SKIP_PUSH = '-q' in sys.argv def get_changed_dockerfiles(): @@ -33,9 +34,12 @@ def main(): steps = [("Building", "docker build --pull -t {0}/{1} -f {1} . ".format( - REGISTRY_URL, fname)), - ("Pushing", "docker push {0}/{1}".format(REGISTRY_URL, - fname))] + REGISTRY_URL, fname))] + if not SKIP_PUSH: + steps.append(("Pushing", "docker push {0}/{1}".format(REGISTRY_URL, + fname))) + else: + print("Skiping push...") print('-' * 79) -- GitLab