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