From 03557b7c152ca308247c1b0d97ad1e46e1385dd7 Mon Sep 17 00:00:00 2001 From: stilobique-surface Date: Sat, 24 Dec 2022 15:46:16 +0100 Subject: [PATCH] Try to change the docker tag "latest" setup, and update the CI with this config --- .gitlab-ci.yml | 1 + main.py | 14 ++++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3b5c928..9c70dee 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -13,3 +13,4 @@ job-build-docker-latest: - python3 -m pip install --upgrade pip - python3 -m pip install -r requirement-build.txt - python3 main.py + - python3 main.py --tag=latest diff --git a/main.py b/main.py index 37f64ae..e1cf1c1 100644 --- a/main.py +++ b/main.py @@ -2,6 +2,7 @@ import os import pathlib import json import docker +import sys # TODO Update readme file badge with blender version # TODO add a check if the image build are stored in the docker register @@ -53,7 +54,12 @@ def build_docker(b3d_version: (str, str), latest: bool = False): if __name__ == "__main__": version = get_data_from_json() print(f'Start -> Setup the package with blender version "{version[0]}.{version[1]}"') - print('Generate image with tag version.') - build_docker(b3d_version=version) - print('Generate image to latest tag.') - build_docker(b3d_version=version, latest=True) + for arg in sys.argv: + if '--tag=' in arg: + print(f'Build with the tag "{arg}".') + build_docker(b3d_version=version, latest=True) + break + else: + build_docker(b3d_version=version) + print(f'Start to build the docker file.') + pass