[gimp-help] gitlab-ci: split the dependency installation into an image job.



commit f7f1f88b9f756b71ee398be49511381411a37bd4
Author: Jehan <jehan girinstud io>
Date:   Wed Mar 16 15:01:42 2022 +0100

    gitlab-ci: split the dependency installation into an image job.
    
    Similar to what we have on GIMP main repository.
    
    (cherry picked from commit 6f256dc8789956fa88dddd14af561534ea16cc8c)

 .gitlab-ci.yml | 39 +++++++++++++++++++++------------------
 1 file changed, 21 insertions(+), 18 deletions(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index f82f0b315..37086886b 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,6 +1,7 @@
 image: debian:testing
 
 stages:
+  - prepare
   - build
 
 variables:
@@ -8,32 +9,33 @@ variables:
   INSTALL_PREFIX: "${CI_PROJECT_DIR}/${INSTALL_DIR}"
   LINGUAS: "en ja"
 
+build-image:
+  stage: prepare
+  variables:
+    GIT_STRATEGY: none
+  cache: {}
+  image:
+    name: gcr.io/kaniko-project/executor:debug
+    entrypoint: [""]
+  script:
+    - mkdir -p /kaniko/.docker
+    - echo 
"{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" 
/kaniko/.docker/config.json
+    - echo "FROM debian:testing" > Dockerfile
+    - echo "RUN apt-get update" >> Dockerfile
+    - echo "RUN apt-get install -y --no-install-recommends \\" >> Dockerfile
+    - echo "automake build-essential docbook-website docbook-xml docbook-xsl fonts-noto-cjk gettext 
librsvg2-2 librsvg2-bin pkg-config pngcrush pngnq python3 python3-libxml2 xsltproc" >> Dockerfile
+
+    - /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination 
$CI_REGISTRY_IMAGE:build-debian-latest --cache=true --cache-ttl=120h
+
 build-debian:
   stage: build
+  image: $CI_REGISTRY_IMAGE:build-debian-latest
   artifacts:
     expire_in: 1 week
     when: always
     paths:
     - www/
     - html/
-  before_script:
-    - apt-get update
-    - apt-get install -y --no-install-recommends
-        automake
-        build-essential
-        docbook-website
-        docbook-xml
-        docbook-xsl
-        fonts-noto-cjk
-        gettext
-        librsvg2-2
-        librsvg2-bin
-        pkg-config
-        pngcrush
-        pngnq
-        python3
-        python3-libxml2
-        xsltproc
   script:
     - mkdir _build
     - cd _build
@@ -47,3 +49,4 @@ build-debian:
     - cd ../_build/quickreference
     - mv ./pdf/ ../../html/2.99/pdf/
   timeout: 2 hours 30 minutes
+  needs: ["build-image"]


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]