[evince/wip/gpoo/image-rebuild] ci: Install docker to rebuild image




commit cae4da1421d9ea6239874177c5632bce536e06a7
Author: Germán Poo-Caamaño <gpoo gnome org>
Date:   Thu Aug 25 12:11:45 2022 -0400

    ci: Install docker to rebuild image

 .gitlab-ci.yml               | 28 +++++++++++++++++++---------
 .gitlab-ci/ubuntu.Dockerfile | 35 +++++++++++++++++++++++++++++++++--
 2 files changed, 52 insertions(+), 11 deletions(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 5d7a27a8c..1708df7bb 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -65,16 +65,26 @@ nightly:
         - flatpak
     extends: .publish_nightly
 
-update registry image:
-    image: registry.gitlab.gnome.org/gnome/evince/x86_64-ubuntu:poppler
+update image:
+    variables:
+        IMAGE_TAG: $CI_REGISTRY_IMAGE/x86_64-ubuntu:poppler
+        # Tell 'docker:dind' to enable TLS (recommended)
+        # and generate certificates in the specified directory.
+        DOCKER_TLS_CERTDIR: "/certs"
+    image: docker:latest
     stage: image
+    # Specify an additional image 'docker:dind' ("Docker-in-Docker") that
+    # will start up the Docker daemon when it is brought up by a runner.
+    services:
+        - docker:dind
     script:
-        - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
-        - docker build -t $CI_REGISTRY_IMAGE -f .gitlab-ci/ubuntu.Dockerfile
+        - docker login -u $CI_REGISTRY_USER --password-stdin $CI_REGISTRY < $CI_REGISTRY_PASSWORD
+        - ls -l .gitlab-ci
+        - docker build -t $IMAGE_TAG -f .gitlab-ci/ubuntu.Dockerfile .
     when: manual
-    only:
-        - web
-        - main
+    # only:
+    #    - web
+    #    - main
     except:
-        variables:
-            - $CI_PROJECT_NAMESPACE != "GNOME"
+       variables:
+           - $CI_PROJECT_NAMESPACE != "GNOME"
diff --git a/.gitlab-ci/ubuntu.Dockerfile b/.gitlab-ci/ubuntu.Dockerfile
index 23e4d11e6..31c24e6f7 100644
--- a/.gitlab-ci/ubuntu.Dockerfile
+++ b/.gitlab-ci/ubuntu.Dockerfile
@@ -1,9 +1,40 @@
 FROM ubuntu:22.04
 
 ENV LANG C.UTF-8
+ENV DEBIAN_FRONTEND noninteractive
 
-ADD setup-ubuntu.sh /opt/
-RUN /bin/sh /opt/setup-ubuntu.sh
+RUN apt-get -yqq update \
+&& apt-get -yqq install --no-install-recommends \
+    apt-utils \
+&& apt-get -yqq install --no-install-recommends \
+    gnome-common libglib2.0-dev-bin \
+    yelp-tools itstool appstream \
+    libgirepository1.0-dev libgtk-3-dev \
+    libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev \
+    libxml2-dev libxml2-utils \
+    libarchive-dev \
+    libsecret-1-dev libgspell-1-dev \
+    libgnome-desktop-3-dev libnautilus-extension-dev \
+    libspectre-dev libtiff5-dev libdjvulibre-dev \
+    libkpathsea-dev libgxps-dev libsynctex-dev \
+    git ccache systemd ninja-build meson \
+    cmake \
+&& apt-get -yqq install --no-install-recommends \
+    python3-pip python3-jinja2 python3-toml python3-typogrify \
+&& pip install gi-docgen \
+&& apt-get -yqq install --no-install-recommends \
+    poppler-data libboost-container-dev libopenjp2-7-dev libcurl4-openssl-dev \
+&& git clone --depth 1 --branch poppler-22.07.0 \
+    https://gitlab.freedesktop.org/poppler/poppler.git /tmp/poppler \
+&& cd /tmp/poppler \
+&& cmake -DBUILD_GTK_TESTS=OFF, -DBUILD_CPP_TESTS=OFF, -DENABLE_UTILS=OFF, \
+    -DENABLE_CPP=OFF, -DENABLE_GOBJECT_INTROSPECTION=OFF, \
+    -DENABLE_LIBOPENJPEG=openjpeg2 -DENABLE_QT5=OFF -DENABLE_QT6=OFF \
+    -DBUILD_GTK_TESTS=OFF -DBUILD_CPP_TESTS=OFF -G Ninja . \
+&& ninja && ninja install \
+&& apt-get clean \
+&& rm -rf /tmp/poppler \
+&& useradd -u 1984 -ms /bin/sh user
 
 USER user
 WORKDIR /home/user


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