4 Commits

7 changed files with 86 additions and 4 deletions
@@ -1,5 +1,5 @@
<component name="ProjectRunConfigurationManager"> <component name="ProjectRunConfigurationManager">
<configuration default="false" name="Dockerfile" type="docker-deploy" factoryName="dockerfile" server-name="Docker"> <configuration default="false" name="Build Blender" type="docker-deploy" factoryName="dockerfile" server-name="Docker">
<deployment type="dockerfile"> <deployment type="dockerfile">
<settings> <settings>
<option name="imageTag" value="stilobique/blender:3.4.0" /> <option name="imageTag" value="stilobique/blender:3.4.0" />
@@ -17,7 +17,7 @@
</option> </option>
<option name="buildOnly" value="true" /> <option name="buildOnly" value="true" />
<option name="containerName" value="blender-latest" /> <option name="containerName" value="blender-latest" />
<option name="sourceFilePath" value="Dockerfile" /> <option name="sourceFilePath" value="image/Dockerfile-build-blender" />
<option name="volumeBindings"> <option name="volumeBindings">
<list> <list>
<DockerVolumeBindingImpl> <DockerVolumeBindingImpl>
+23
View File
@@ -0,0 +1,23 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Make Blender Cache" type="PythonConfigurationType" factoryName="Python">
<module name="blender-docker" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<envs>
<env name="PYTHONUNBUFFERED" value="1" />
</envs>
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/generate-image-repo.py" />
<option name="PARAMETERS" value="" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="false" />
<option name="MODULE_MODE" value="false" />
<option name="REDIRECT_INPUT" value="false" />
<option name="INPUT_FILE" value="" />
<method v="2" />
</configuration>
</component>
+2 -1
View File
@@ -1,5 +1,6 @@
[![Blender](https://img.shields.io/badge/blender-3.0.0-%23F5792A.svg?style=flat&logo=blender&logoColor=white)](https://www.blender.org/download/) [![Blender](https://img.shields.io/badge/blender-3.10.0-%23F5792A.svg?style=flat&logo=blender&logoColor=white)](https://www.blender.org/download/)
[![pipeline status](https://gitlab.com/stilobique/blender-docker/badges/main/pipeline.svg)](https://gitlab.com/stilobique/blender-docker/-/commits/main) [![pipeline status](https://gitlab.com/stilobique/blender-docker/badges/main/pipeline.svg)](https://gitlab.com/stilobique/blender-docker/-/commits/main)
[![Python Version](https://img.shields.io/badge/python-3.10-brightgreen)](https://www.python.org/)
# Blender Docker # Blender Docker
+41
View File
@@ -0,0 +1,41 @@
import docker
import os
def get_repo_container():
"""
- Check if a blender/csv image local exist
- If yes, check if a container exist
:return:
"""
client = docker.from_env()
if os.environ.get('docker_hub_password'):
client.login(username=os.environ['docker_hub_user'], password=os.environ['docker_hub_password'])
dk_tags = 'stilobique/csv'
dk_container_name = 'blender-cache-repo'
dk_images_local = client.images.list(name=dk_tags)
dk_containers_local = client.containers.list(filters={'label': dk_container_name})
volumes = ["/scripts/:/scripts"]
commandes = ['bash', '/scripts/set_all_repository.sh']
if dk_containers_local:
# The container cache exist, used-it
client.containers.run(image=dk_tags, name=dk_container_name)
pass
elif dk_images_local:
# No container, but the image are build, start a container cache
client.containers.run(image=dk_tags, name=dk_container_name)
pass
else:
# No container, no image ; build a new image and start this cache
client.images.build(path="image", dockerfile="Dockerfile-csv", tag=f'{dk_tags}:latest', rm=True)
client.containers.run(image=dk_tags, name=dk_container_name, volumes=volumes, command=commandes)
if __name__ == "__main__":
# Make or update the docker container
get_repo_container()
print('Blender repo set')
+17
View File
@@ -0,0 +1,17 @@
#!/bin/bash
echo "------------------------------";
echo " > Get the Blender repository";
mkdir -p /opt/blender-git/lib
cd /opt.blender-git/lib || exit 1
git clone https://projects.blender.org/blender/blender.git
echo "------------------------------";
echo " > Get all Blender submodule";
cd /opt/blender-git/blender || exit 1
git submodule update --init --recursive
echo "------------------------------";
echo " > Get the all lib Blender (svn)";
cd /opt/blender-git/lib || exit 1
svn checkout https://svn.blender.org/svnroot/bf-blender/trunk/lib/linux_centos7_x86_64