From 620d1fb4d71fd0bf6faad53496be2879c53dd3a3 Mon Sep 17 00:00:00 2001
From: znerol <znerol@63999.no-reply.drupal.org>
Date: Sat, 26 Apr 2025 23:47:03 +0200
Subject: [PATCH] Issue #3521317: Setup GitLab CI pipeline to build and publish
 container image

---
 gitlab-ci.yml | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)
 create mode 100644 gitlab-ci.yml

diff --git a/gitlab-ci.yml b/gitlab-ci.yml
new file mode 100644
index 0000000..f91ddb5
--- /dev/null
+++ b/gitlab-ci.yml
@@ -0,0 +1,28 @@
+workflow:
+  rules:
+    - if: $CI_COMMIT_TAG
+    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
+
+stages:
+  - build
+
+container-image:
+  interruptible: true
+  stage: build
+  image: quay.io/buildah/stable
+  variables:
+    # Use vfs with buildah. Docker offers overlayfs as a default, but buildah
+    # cannot stack overlayfs on top of another overlayfs filesystem.
+    STORAGE_DRIVER: vfs
+    # Write all image metadata in the docker format, not the standard OCI format.
+    # Newer versions of docker can handle the OCI format, but older versions, like
+    # the one shipped with Fedora 30, cannot handle the format.
+    BUILDAH_FORMAT: docker
+    # You may need this workaround for some errors: https://stackoverflow.com/a/70438141/1233435
+    BUILDAH_ISOLATION: chroot
+  rules:
+    - when: always
+  script:
+    - echo "${DOCKER_HUB_PASSWORD}" | buildah login -u "${DOCKER_HUB_USER}" --password-stdin docker.io
+    - buildah build -t docker.io/drflaky/flaky-tests-scraper:latest .
+    - buildah push docker.io/drflaky/flaky-tests-scraper:latest
-- 
GitLab