[gnome-settings-daemon/wip/claudio/CI: 1/4] CI: create and save Docker images in GNOME GitLab



commit 7a78d410cf0210a0caa99ad97e9fa2e27633664a
Author: Claudio André <claudioandre br gmail com>
Date:   Thu Jul 12 17:58:22 2018 -0300

    CI: create and save Docker images in GNOME GitLab

 .gitlab-ci.yml                                 | 64 ++++++++++++++++++++++++++
 build-aux/ci/Dockerfile.arm64v8.fedora.rawhide | 24 ++++++++++
 build-aux/ci/Dockerfile.fedora.rawhide         | 22 +++++++++
 build-aux/ci/Dockerfile.ppc64le.fedora.rawhide | 24 ++++++++++
 4 files changed, 134 insertions(+)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 2e98381b..f25948a1 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -156,3 +156,67 @@ msan:
   variables:
     BUILD_OPTS: "-Db_sanitize=memory"
     CC: "clang"
+
+#############################################
+#          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]'*}" ]]; 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 00000000..ee00ce56
--- /dev/null
+++ b/build-aux/ci/Dockerfile.arm64v8.fedora.rawhide
@@ -0,0 +1,24 @@
+FROM arm64v8/fedora:rawhide
+MAINTAINER Claudio André (c) 2018 V1.0
+
+LABEL architecture="aarch64"
+LABEL version="1.0"
+LABEL description="Docker image to run CI for GNOME Settings Daemon."
+
+ADD x86_64_qemu-aarch64-static.tar.gz /usr/bin
+
+RUN dnf -y --nogpgcheck upgrade && \
+    dnf -y install \
+                   @c-development @development-tools clang \
+                   alsa-lib-devel colord-devel cups-devel fontconfig-devel geoclue2-devel geocode-glib-devel 
\
+                   gettext git glib2-devel gnome-desktop3-devel gnome-session gobject-introspection \
+                   gsettings-desktop-schemas-devel gtk3-devel lcms2-devel libcanberra-devel libgtop2-devel \
+                   libgudev-devel libgweather-devel libnotify-devel librsvg2-devel libX11-devel libXi-devel \
+                   libXtst-devel libwacom-devel meson NetworkManager-libnm-devel nss-devel perl-interpreter \
+                   polkit-devel pulseaudio-libs-devel pygobject3 python3-dbusmock upower-devel wayland-devel 
\
+                   which xorg-x11-drv-wacom-devel xorg-x11-server-Xvfb xorg-x11-utils mutter \
+                   mesa-dri-drivers llvm && \
+     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 00000000..51246882
--- /dev/null
+++ b/build-aux/ci/Dockerfile.fedora.rawhide
@@ -0,0 +1,22 @@
+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 Daemon."
+
+RUN dnf -y --nogpgcheck upgrade && \
+    dnf -y install \
+                   @c-development @development-tools clang \
+                   alsa-lib-devel colord-devel cups-devel fontconfig-devel geoclue2-devel geocode-glib-devel 
\
+                   gettext git glib2-devel gnome-desktop3-devel gnome-session gobject-introspection \
+                   gsettings-desktop-schemas-devel gtk3-devel lcms2-devel libcanberra-devel libgtop2-devel \
+                   libgudev-devel libgweather-devel libnotify-devel librsvg2-devel libX11-devel libXi-devel \
+                   libXtst-devel libwacom-devel meson NetworkManager-libnm-devel nss-devel perl-interpreter \
+                   polkit-devel pulseaudio-libs-devel pygobject3 python3-dbusmock upower-devel wayland-devel 
\
+                   which xorg-x11-drv-wacom-devel xorg-x11-server-Xvfb xorg-x11-utils mutter \
+                   mesa-dri-drivers 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 00000000..ea5cba58
--- /dev/null
+++ b/build-aux/ci/Dockerfile.ppc64le.fedora.rawhide
@@ -0,0 +1,24 @@
+FROM ppc64le/fedora:rawhide
+MAINTAINER Claudio André (c) 2018 V1.0
+
+LABEL architecture="ppc64le"
+LABEL version="1.0"
+LABEL description="Docker image to run CI for GNOME Settings Daemon."
+
+ADD x86_64_qemu-ppc64le-static.tar.gz /usr/bin
+
+RUN dnf -y --nogpgcheck upgrade && \
+    dnf -y install \
+                   @c-development @development-tools clang \
+                   alsa-lib-devel colord-devel cups-devel fontconfig-devel geoclue2-devel geocode-glib-devel 
\
+                   gettext git glib2-devel gnome-desktop3-devel gnome-session gobject-introspection \
+                   gsettings-desktop-schemas-devel gtk3-devel lcms2-devel libcanberra-devel libgtop2-devel \
+                   libgudev-devel libgweather-devel libnotify-devel librsvg2-devel libX11-devel libXi-devel \
+                   libXtst-devel libwacom-devel meson NetworkManager-libnm-devel nss-devel perl-interpreter \
+                   polkit-devel pulseaudio-libs-devel pygobject3 python3-dbusmock upower-devel wayland-devel 
\
+                   which xorg-x11-drv-wacom-devel xorg-x11-server-Xvfb xorg-x11-utils mutter \
+                   mesa-dri-drivers llvm && \
+     dnf -y clean all
+
+CMD ["/bin/bash"]
+


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