mirror of
https://gitlab.com/stilobique/blender-docker.git
synced 2026-05-28 04:37:47 +02:00
Add todo and docstring about the main file.
Clear unused variable.
This commit is contained in:
@@ -3,10 +3,13 @@ import pathlib
|
|||||||
import json
|
import json
|
||||||
import docker
|
import docker
|
||||||
|
|
||||||
|
# TODO Update readme file badge with blender version
|
||||||
|
# TODO add a check if the image build are stored in the docker register
|
||||||
|
|
||||||
|
|
||||||
def get_data_from_json() -> (str, str):
|
def get_data_from_json() -> (str, str):
|
||||||
|
"""From the json file, get blender version (major and minor), and return this information."""
|
||||||
file = pathlib.Path(os.getcwd(), 'build.json')
|
file = pathlib.Path(os.getcwd(), 'build.json')
|
||||||
data: dict = {}
|
|
||||||
|
|
||||||
with open(file, 'r') as f:
|
with open(file, 'r') as f:
|
||||||
data = json.load(f)
|
data = json.load(f)
|
||||||
@@ -20,6 +23,10 @@ def get_data_from_json() -> (str, str):
|
|||||||
|
|
||||||
|
|
||||||
def build_docker(b3d_version: (str, str), latest: bool = False):
|
def build_docker(b3d_version: (str, str), latest: bool = False):
|
||||||
|
"""
|
||||||
|
Generate docker image, request the blender version (major, minor) with the keyword b3d_version, and can be
|
||||||
|
tagged with latest or only blender version info.
|
||||||
|
"""
|
||||||
client = docker.from_env()
|
client = docker.from_env()
|
||||||
if os.environ.get('docker_hub_password'):
|
if os.environ.get('docker_hub_password'):
|
||||||
client.login(username=os.environ['docker_hub_user'], password=os.environ['docker_hub_password'])
|
client.login(username=os.environ['docker_hub_user'], password=os.environ['docker_hub_password'])
|
||||||
|
|||||||
Reference in New Issue
Block a user