src/cmd-remote-build-container: appease flake8
@@ -12,6 +12,7 @@ from os import environ
logging.basicConfig(level=logging.INFO,
format="%(asctime)s %(levelname)s - %(message)s")
+
def build_container_image(labels, gitURL, gitRef, repo, tag):
'''
Build the image using podman remote and push to the registry
@@ -25,6 +26,7 @@ def build_container_image(labels, gitURL, gitRef, repo, tag):
# Long running command. Send output to stdout for logging
runcmd(cmd)
+
def push_container_image(repo, tag):
'''
Push image to registry
@@ -51,6 +53,7 @@ def push_container_image(repo, tag):
else:
raise Exception(f"Image pushed but not viewable in registry: tag: {tag}")
+
def is_tag_in_podman_storage(repo, tag):
'''
Search for a tag in the local podman storage
@@ -60,6 +63,7 @@ def is_tag_in_podman_storage(repo, tag):
cmd = ["podman", "--remote", "image", "exists", f"{repo}:{tag}"]
return runcmd(cmd, check=False, capture_output=True).returncode == 0
+
def is_tag_in_registry(repo, tag):
'''
Search for a tag in the registry
@@ -73,6 +77,7 @@ def is_tag_in_registry(repo, tag):
return True
return False
+
def main():
# Arguments
args = parse_args()
@@ -113,6 +118,7 @@ def main():
logging.info("Pushing to remote registry")
push_container_image(args.repo, args.tag)
+
def parse_args():
parser = argparse.ArgumentParser(
prog="CoreOS Assembler Remote Build",
