From 9a7b62cb050a1ea8c48b2db8a01bd939cb613e11 Mon Sep 17 00:00:00 2001 From: stilobique Date: Sun, 12 Jun 2022 17:20:40 +0200 Subject: [PATCH] Fix tag name call with the push function --- main.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/main.py b/main.py index 88151bf..8fb8232 100644 --- a/main.py +++ b/main.py @@ -24,9 +24,8 @@ def get_data_from_json() -> (str, str): def build_docker(b3d_version: (str, str)): client = docker.from_env() if os.environ.get('docker_hub_password'): - user = os.environ['docker_hub_user'] - password = os.environ['docker_hub_password'] - client.login(username=user, password=password) + print(' -> Login with docker') + client.login(username=os.environ['docker_hub_user'], password=os.environ['docker_hub_password']) # Init all data to build the docker image args = { @@ -36,14 +35,15 @@ def build_docker(b3d_version: (str, str)): docker_repo = 'stilobique/blender' tag_name = f'{docker_repo}:{args["b3d_vs_major"]}.{args["b3d_vs_minor"]}' + print('2 -> Build from image file') client.images.build(path=os.getcwd(), buildargs=args, tag=tag_name) - client.images.push(repository=docker_repo, tag=tag_name) + + print('3 -> Push the new images') + client.images.push(repository=docker_repo, tag=f'{args["b3d_vs_major"]}.{args["b3d_vs_minor"]}') if __name__ == "__main__": print('1 -> Setup the package') - logging.info('1 -> Setup the package') + logging.info('1 -> Setup the package log') version = get_data_from_json() - print('2 -> Build from image file') build_docker(version) - print('3 -> Push the new images')