[gnome-control-center] CI: build and save Docker images in GNOME GitLab



commit 185e53169f88ebaf6343bb8269cca37b45b2f53c
Author: Claudio André <claudioandre br gmail com>
Date:   Thu Jul 5 15:08:24 2018 -0300

    CI: build and save Docker images in GNOME GitLab

 .gitlab-ci.yml                                 | 64 ++++++++++++++++++++++++++
 build-aux/ci/Dockerfile.arm64v8.fedora.rawhide | 26 +++++++++++
 build-aux/ci/Dockerfile.fedora.rawhide         | 24 ++++++++++
 build-aux/ci/Dockerfile.ppc64le.fedora.rawhide | 26 +++++++++++
 4 files changed, 140 insertions(+)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 3a5fc53a6..269ce8a87 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -271,3 +271,67 @@ ppc64le:
     DOCKER_DRIVER: overlay
     IMAGE: "claudioandre/settings:fedora.ppc64le"
   when: manual
+
+#############################################
+#          Create CI Docker Images          #
+#############################################
+.Docker image template: &create_docker_image
+  image: docker:latest
+  stage: delivery
+  services:
+    - docker:dind
+  only:
+    variables:
+      - $CRON_TASK == "BUILD_CI_IMAGES"
+
+  script:
+    # Skip the build (if requested)
+    - |
+      if [[ -z "${CI_COMMIT_MESSAGE##*[skip images]*}" && -z "${CI_COMMIT_MESSAGE##*$NAME*}" ]]; then
+        echo "== Nothing to do =="
+        exit 0
+      fi
+
+    # Get multiarch stuff
+    - |
+      if [[ -n "${TARGET_ARCH}" ]]; then
+        docker run --rm --privileged multiarch/qemu-user-static:register --reset
+        wget 
https://github.com/multiarch/qemu-user-static/releases/download/v2.12.0/x86_64_qemu-${TARGET_ARCH}-static.tar.gz
+      fi
+
+    # Build using the Dockerfile
+    - docker build -f "$DOCKERFILE" -t "$CI_REGISTRY_IMAGE:$NAME" .
+
+    # Prepare to publish
+    - docker tag "$CI_REGISTRY_IMAGE:$NAME" "$CI_REGISTRY_IMAGE:job-"$CI_JOB_ID"_$NAME"
+    - docker images
+    - docker login ${CI_REGISTRY} -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD}
+
+    # Publish (if running on a schedule)
+    - |
+      if [[ "${CI_PIPELINE_SOURCE}" == "schedule" ]]; then
+        docker push "$CI_REGISTRY_IMAGE"
+      fi
+
+fedora.dev:
+  <<: *create_docker_image
+  variables:
+    DOCKER_DRIVER: overlay
+    DOCKERFILE: "build-aux/ci/Dockerfile.fedora.rawhide"
+    NAME: "fedora.dev"
+
+fedora.aarch64:
+  <<: *create_docker_image
+  variables:
+    DOCKER_DRIVER: overlay
+    DOCKERFILE: "build-aux/ci/Dockerfile.arm64v8.fedora.rawhide"
+    NAME: "fedora.aarch64"
+    TARGET_ARCH: "aarch64"
+
+fedora.ppc64le:
+  <<: *create_docker_image
+  variables:
+    DOCKER_DRIVER: overlay
+    DOCKERFILE: "build-aux/ci/Dockerfile.ppc64le.fedora.rawhide"
+    NAME: "fedora.ppc64le"
+    TARGET_ARCH: "ppc64le"
diff --git a/build-aux/ci/Dockerfile.arm64v8.fedora.rawhide b/build-aux/ci/Dockerfile.arm64v8.fedora.rawhide
new file mode 100644
index 000000000..ed3acdbe8
--- /dev/null
+++ b/build-aux/ci/Dockerfile.arm64v8.fedora.rawhide
@@ -0,0 +1,26 @@
+FROM arm64v8/fedora:rawhide
+MAINTAINER Claudio André (c) 2018 V1.0
+
+LABEL architecture="aarch64"
+LABEL version="1.0"
+LABEL description="Multiarch Docker image to run CI for GNOME Settings."
+
+ADD x86_64_qemu-aarch64-static.tar.gz /usr/bin
+
+RUN dnf -y --nogpgcheck upgrade && \
+    dnf -y install \
+                   @c-development @development-tools clang \
+                   accountsservice-devel cheese-libs-devel chrpath clutter-gtk-devel colord-devel  \
+                   colord-gtk-devel cups-devel desktop-file-utils docbook-style-xsl gdk-pixbuf2-devel \
+                   gettext git glib2-devel gnome-bluetooth-libs-devel gnome-desktop3-devel \
+                   gnome-online-accounts-devel gnome-settings-daemon-devel grilo-devel \
+                   gsettings-desktop-schemas-devel gtk3-devel ibus-devel intltool libcanberra-devel \
+                   libgtop2-devel libgudev-devel libnma-devel libpwquality-devel libsmbclient-devel \
+                   libsoup-devel libwacom-devel libX11-devel libXi-devel libxml2-devel libxslt \
+                   libXxf86misc-devel meson ModemManager-glib-devel NetworkManager-libnm-devel \
+                   polkit-devel pulseaudio-libs-devel upower-devel \
+                   python3-dbusmock xorg-x11-server-Xvfb mesa-dri-drivers libsecret-devel && \
+     dnf -y clean all
+
+CMD ["/bin/bash"]
+
diff --git a/build-aux/ci/Dockerfile.fedora.rawhide b/build-aux/ci/Dockerfile.fedora.rawhide
new file mode 100644
index 000000000..30dd1afa9
--- /dev/null
+++ b/build-aux/ci/Dockerfile.fedora.rawhide
@@ -0,0 +1,24 @@
+FROM fedora:rawhide
+MAINTAINER Claudio André (c) 2018 V1.0
+
+LABEL architecture="x86_64"
+LABEL version="1.0"
+LABEL description="Docker image to run CI for GNOME Settings."
+
+RUN dnf -y --nogpgcheck upgrade && \
+    dnf -y install \
+                   @c-development @development-tools clang \
+                   accountsservice-devel cheese-libs-devel chrpath clutter-gtk-devel colord-devel  \
+                   colord-gtk-devel cups-devel desktop-file-utils docbook-style-xsl gdk-pixbuf2-devel \
+                   gettext git glib2-devel gnome-bluetooth-libs-devel gnome-desktop3-devel \
+                   gnome-online-accounts-devel gnome-settings-daemon-devel grilo-devel \
+                   gsettings-desktop-schemas-devel gtk3-devel ibus-devel intltool libcanberra-devel \
+                   libgtop2-devel libgudev-devel libnma-devel libpwquality-devel libsmbclient-devel \
+                   libsoup-devel libwacom-devel libX11-devel libXi-devel libxml2-devel libxslt \
+                   libXxf86misc-devel meson ModemManager-glib-devel NetworkManager-libnm-devel \
+                   polkit-devel pulseaudio-libs-devel upower-devel \
+                   python3-dbusmock xorg-x11-server-Xvfb mesa-dri-drivers libsecret-devel llvm && \
+     dnf -y clean all
+
+CMD ["/bin/bash"]
+
diff --git a/build-aux/ci/Dockerfile.ppc64le.fedora.rawhide b/build-aux/ci/Dockerfile.ppc64le.fedora.rawhide
new file mode 100644
index 000000000..f6d9d0602
--- /dev/null
+++ b/build-aux/ci/Dockerfile.ppc64le.fedora.rawhide
@@ -0,0 +1,26 @@
+FROM ppc64le/fedora:rawhide
+MAINTAINER Claudio André (c) 2018 V1.0
+
+LABEL architecture="ppc64le"
+LABEL version="1.0"
+LABEL description="Multiarch Docker image to run CI for GNOME Settings."
+
+ADD x86_64_qemu-ppc64le-static.tar.gz /usr/bin
+
+RUN dnf -y --nogpgcheck upgrade && \
+    dnf -y install \
+                   @c-development @development-tools clang \
+                   accountsservice-devel cheese-libs-devel chrpath clutter-gtk-devel colord-devel  \
+                   colord-gtk-devel cups-devel desktop-file-utils docbook-style-xsl gdk-pixbuf2-devel \
+                   gettext git glib2-devel gnome-bluetooth-libs-devel gnome-desktop3-devel \
+                   gnome-online-accounts-devel gnome-settings-daemon-devel grilo-devel \
+                   gsettings-desktop-schemas-devel gtk3-devel ibus-devel intltool libcanberra-devel \
+                   libgtop2-devel libgudev-devel libnma-devel libpwquality-devel libsmbclient-devel \
+                   libsoup-devel libwacom-devel libX11-devel libXi-devel libxml2-devel libxslt \
+                   libXxf86misc-devel meson ModemManager-glib-devel NetworkManager-libnm-devel \
+                   polkit-devel pulseaudio-libs-devel upower-devel \
+                   python3-dbusmock xorg-x11-server-Xvfb mesa-dri-drivers libsecret-devel && \
+     dnf -y clean all
+
+CMD ["/bin/bash"]
+


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