diff --git a/README.md b/README.md index 7daadf939077069629200adc6e8d82c294059ab3..3c6c32817d60f4b3f4a0656d6ec386f1699637e7 100644 --- a/README.md +++ b/README.md @@ -78,6 +78,7 @@ Although it is unlkely that either your username or your password will actually | IMAGE_NAME_EXTRA | Modify the image name to be `<image-name>-<image-name-extra>`. (Default: None) | | VERSION_FILE_PATH | If set, full docker image name will be saved under given path. | | DOCKER_IMAGE_ARTIFACT | The docker image can be passed between stages as a gitlab artifact. This variable allows you to change the name of the file created. (Default: `<image-name>-<image-name-extra>.tar`) | +| NOTEST | Do not try pulling the image to verify that the publish worked (Some registries take time to make the image available) | ## Using artefact to store docker image between builds diff --git a/buildlib/__init__.py b/buildlib/__init__.py index 4d8e2671a966edb83a83c4b96053b668b3de9c40..409e7542dabfd81d2223102afe8da1c95f8ed176 100644 --- a/buildlib/__init__.py +++ b/buildlib/__init__.py @@ -186,12 +186,13 @@ def deploy(): pass # Pull - print("* Test publish by pulling") - for line in llclient.pull(PUBLISH_NAME, CI_COMMIT_SHA, stream=True, decode=True): - if "status" in line: - print(line["status"]) - client.images.remove("%s:%s" % (PUBLISH_NAME, CI_COMMIT_SHA)) - print("* Publish complete") + if "NOTEST" not in os.environ: + print("* Test publish by pulling") + for line in llclient.pull(PUBLISH_NAME, CI_COMMIT_SHA, stream=True, decode=True): + if "status" in line: + print(line["status"]) + client.images.remove("%s:%s" % (PUBLISH_NAME, CI_COMMIT_SHA)) + print("* Publish complete") def deploy_k8s(filelist=None): "Deploy to Kubernetes"