[epiphany/docker-imager] CI: Use docker image to speed up jobs




commit 72fc257c043d2287c51818421d13022b58b3cafb
Author: Jan-Michael Brummer <jan brummer tabos org>
Date:   Wed Aug 12 16:48:35 2020 +0200

    CI: Use docker image to speed up jobs
    
    Style check job installs dependencies on each run. This
    causes that the pipelines take a long time. Let's use a custom docker
    image to not block runners for such a long time and to get the pipeline
    results faster. This commit also adds a new job to generate the docker
    image for us.

 .gitlab-ci.yml        | 30 ++++++++++++++++++++++++++----
 .gitlab-ci/Dockerfile |  5 +++++
 2 files changed, 31 insertions(+), 4 deletions(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 26c724b8a..305b0d4b0 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -12,19 +12,39 @@ variables:
   APP_ID: 'org.gnome.Epiphany.Devel'
 
 stages:
+  - image
   - test
 
+update image:
+    variables:
+         DOCKER_TLS_CERTDIR: ""
+    image: docker:latest
+    stage: image
+    tags:
+        - privileged
+    services:
+        - docker:dind
+    script:
+        - docker build --tag $CI_REGISTRY_IMAGE .gitlab/
+        - docker tag $CI_REGISTRY_IMAGE "$CI_REGISTRY_IMAGE:v$CI_JOB_ID"
+        - docker login $CI_REGISTRY -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD
+        - docker push $CI_REGISTRY_IMAGE
+    when: manual
+    variables:
+        - $CI_PROJECT_NAMESPACE == "GNOME"
+
 check-code-style:
-  stage: .pre
-  image: alpine:latest
+  stage: test
+  image: registry.gitlab.gnome.org/gnome/epiphany/master:v1
   interruptible: true
-  before_script:
-    - apk update && apk add uncrustify bash python3
   script:
     - bash data/check-code-style
+  dependencies:
+    - update image
 
 flatpak:
   extends: '.flatpak'
+  stage: test
   variables:
     CONFIG_OPTS: '-Dprofile=Devel -Dunit_tests=enabled --werror'
   except:
@@ -32,6 +52,7 @@ flatpak:
 
 flatpak master:
   extends: '.flatpak'
+  stage: test
   variables:
     CONFIG_OPTS: '-Dtech_preview=true -Dprofile=Devel'
   only:
@@ -39,6 +60,7 @@ flatpak master:
 
 flatpak scanbuild:
   extends: '.flatpak'
+  stage: test
   variables:
     CONFIG_OPTS: '-Dprofile=Devel -Dunit_tests=enabled --werror'
   script:
diff --git a/.gitlab-ci/Dockerfile b/.gitlab-ci/Dockerfile
new file mode 100644
index 000000000..7da2e88d7
--- /dev/null
+++ b/.gitlab-ci/Dockerfile
@@ -0,0 +1,5 @@
+FROM fedora:rawhide
+
+RUN dnf install -y dnf-plugins-core uncrustify findutils git \
+    && dnf builddep -y epiphany \
+    && dnf clean all


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