Fix tag name call with the push function

This commit is contained in:
2022-06-12 17:20:40 +02:00
parent 949aea1636
commit 9a7b62cb05
+7 -7
View File
@@ -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')