From ad9281942e907023adc1ffd31a1f83e67d73c755 Mon Sep 17 00:00:00 2001 From: stilobique-surface Date: Sat, 24 Dec 2022 17:42:39 +0100 Subject: [PATCH] Try to config a git cache --- .gitlab-ci.yml | 22 +++++++++++++++++++++- Dockerfile | 12 +++++++++--- 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9c70dee..1808eaf 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,6 +1,26 @@ image: docker:19.03.12 -job-build-docker-latest: +stages: + - update + - build + +cache: + key: blender-source + paths: + - /opt/blender-git/blender # Blender git repository source + - /opt/blender-git/lib # Blender Subversion lib package + policy: pull + +update: + stage: update + cache: + key: blender-source + script: + - cd /opt/blender-git + - clone https://git.blender.org/blender.git + - svn checkout + +build: rules: - changes: - build.json diff --git a/Dockerfile b/Dockerfile index 6584c68..90f81e3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,6 +3,7 @@ FROM ubuntu:22.04 AS blender # Setup all software version request ARG b3d_vs_major=2.90 ARG b3d_vs_minor=0 +ARG subversion=63014 LABEL Author="stilobique" LABEL Title="Blender Docker for Unit Test" @@ -27,14 +28,19 @@ RUN apt-get update && apt-get install -y \ libxi-dev \ python3 +# Debug +RUN echo Build Blender v${b3d_vs_major}.${b3d_vs_minor} + +ADD . /opt/blender-git + # Compile Blender -RUN mkdir /opt/blender-git/ && cd /opt/blender-git/ \ - && git clone -b v${b3d_vs_major}.${b3d_vs_minor} --depth 1 https://git.blender.org/blender.git \ +RUN cd /opt/blender-git/ \ + && git checkout v${b3d_vs_major}.${b3d_vs_minor} \ && git config --global user.email "contact@aurelien-vaillant.net" \ && git config --global user.name "Aurelien Vaillant" \ && mkdir /opt/blender-git/lib \ && cd /opt/blender-git/lib \ - && svn checkout https://svn.blender.org/svnroot/bf-blender/trunk/lib/linux_centos7_x86_64 \ + && svn checkout -r${subversion} https://svn.blender.org/svnroot/bf-blender/trunk/lib/linux_centos7_x86_64 \ && cd /opt/blender-git/blender \ && git submodule update --init --recursive \ && make