mirror of
https://gitlab.com/stilobique/blender-docker.git
synced 2026-05-27 20:27:47 +02:00
Fix tag name call with the push function
This commit is contained in:
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user