[gnome-runtime-images/alatiera/multiarch-tags] try multi-arch tags




commit 7ff37a52918bed796d4cd54f517f71d163797fdd
Author: Jordan Petridis <jordan centricular com>
Date:   Thu Jul 7 21:02:18 2022 +0300

    try multi-arch tags

 .gitlab-ci.yml | 107 ++++++++++++++++++++++++---------------------------------
 1 file changed, 44 insertions(+), 63 deletions(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 1d208ad..73372ae 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -13,6 +13,7 @@ stages:
 
 default:
     before_script:
+        - sudo dnf install -y qemu-user-static
         - buildah login -u gitlab-ci-token -p ${CI_JOB_TOKEN} ${CI_REGISTRY}
     interruptible: true
     retry: 1
@@ -20,21 +21,31 @@ default:
 # Expects ${DOCKERIMAGE} which should be the name+tag of the registry image.
 # Expects ${DOCKERFILE} variable which should be the path to the Dockerfile.
 .dockerfile_template:
+    variables:
+      MANIFEST: 'gnome-nightly-manifest'
     script:
         # For debugging
         - echo ${DOCKERFILE} / ${DOCKERIMAGE}
 
-        - buildah bud -f ${DOCKERFILE} -t ${DOCKERIMAGE} .
+        - buildah manifest create ${MANIFEST_NAME}
+        - |-
+          buildah bud --manifest $MANIFEST
+            --arch amd64
+            --tag ${DOCKERIMAGE}
+            -f ${DOCKERFILE} .
+
+        - |-
+          buildah bud --manifest $MANIFEST
+            --arch arm64
+            --tag ${DOCKERIMAGE}
+            -f ${DOCKERFILE} .
+
         # push only on master branch
-        - |
+        - |-
           if [ $CI_COMMIT_REF_NAME == master ]; then
-              buildah push ${DOCKERIMAGE}
-
-              # Tag `x86_64` also without the ARCH to not break the old path
-              if [ $ARCH == "x86_64" ]; then
-                  buildah tag $DOCKERIMAGE $DOCKERIMAGE_OLD
-                  buildah push $DOCKERIMAGE_OLD
-              fi
+            buildah manifest push --all
+              ${MANIFEST_NAME}
+              "docker://${DOCKERIMAGE}"
           fi
     after_script:
         # don't try to use systemd/journald
@@ -51,32 +62,22 @@ default:
 
 base:
     stage: base
-    extends: ['.dockerfile_template', '.vars_x86_64']
-    variables:
-        DOCKERIMAGE: ${CI_REGISTRY_IMAGE}/${ARCH}/base
-        DOCKERIMAGE_OLD: ${CI_REGISTRY_IMAGE}/base
-        DOCKERFILE: base
-
-base:aarch64:
-    stage: base
-    extends: ['.dockerfile_template', '.vars_aarch64']
+    extends: ['.dockerfile_template']
+    tags:
+      - x86_64
+      - crun
     variables:
-        DOCKERIMAGE: ${CI_REGISTRY_IMAGE}/${ARCH}/base
+        DOCKERIMAGE: ${CI_REGISTRY_IMAGE}/base
         DOCKERFILE: base
 
 flat-manager-client:
     stage: base
-    extends: ['.dockerfile_template', '.vars_x86_64']
+    extends: ['.dockerfile_template']
+    tags:
+      - x86_64
+      - crun
     variables:
-        DOCKERIMAGE: ${CI_REGISTRY_IMAGE}/${ARCH}/flat-manager-client
-        DOCKERIMAGE_OLD: ${CI_REGISTRY_IMAGE}/flat-manager-client
-        DOCKERFILE: flat-manager-client/Dockerfile
-
-flat-manager-client:aarch64:
-    stage: base
-    extends: ['.dockerfile_template', '.vars_aarch64']
-    variables:
-        DOCKERIMAGE: ${CI_REGISTRY_IMAGE}/${ARCH}/flat-manager-client
+        DOCKERIMAGE: ${CI_REGISTRY_IMAGE}/flat-manager-client
         DOCKERFILE: flat-manager-client/Dockerfile
 
 # Expects ${BRANCH} and ${FD_BRANCH} variables which are the gnome branch and the freedesktop-sdk
@@ -86,9 +87,9 @@ flat-manager-client:aarch64:
     script:
         # build the flatpak sdk image
         - |
-          CONTAINER=$(buildah from ${CI_REGISTRY_IMAGE}/${ARCH}/base)
+          CONTAINER=$(buildah from ${CI_REGISTRY_IMAGE}/base)
 
-          export TAG="${CI_REGISTRY_IMAGE}/${ARCH}/gnome:${BRANCH}"
+          export TAG="${CI_REGISTRY_IMAGE}/gnome:${BRANCH}"
           echo "Building $TAG"
 
           buildah run $CONTAINER flatpak install --user --noninteractive \
@@ -111,29 +112,8 @@ flat-manager-client:aarch64:
           if [ $CI_COMMIT_REF_NAME == master ]; then
               echo "Pushing $TAG"
               buildah push $TAG
-
-              # This is for backwards compatibility
-              if [ $ARCH == "x86_64" ]; then
-                  # Tag `x86_64` also without the ARCH to not break the old path
-                  export TAG_OLD="${CI_REGISTRY_IMAGE}/gnome:${BRANCH}"
-                  buildah tag $TAG $TAG_OLD
-                  buildah push $TAG_OLD
-              fi
           fi
 
-.vars_aarch64:
-  tags:
-    - aarch64
-  variables:
-    ARCH: aarch64
-
-.vars_x86_64:
-  tags:
-    - x86_64
-    - crun
-  variables:
-    ARCH: x86_64
-
 .vars_nightly:
   variables:
     BRANCH: master
@@ -174,20 +154,21 @@ flat-manager-client:aarch64:
 
 gnome:nightly:
   stage: 'runtimes'
-  extends: ['.sdk_template', '.vars_nightly', '.vars_x86_64']
+  tags:
+    - x86_64
+    - crun
+  extends: ['.sdk_template', '.vars_nightly']
 
 gnome:41:
   stage: 'runtimes'
-  extends: ['.sdk_template', '.vars_41', '.vars_x86_64']
+  tags:
+    - x86_64
+    - crun
+  extends: ['.sdk_template', '.vars_41']
 
 gnome:42:
   stage: 'runtimes'
-  extends: ['.sdk_template', '.vars_42', '.vars_x86_64']
-
-gnome:aarch64:nightly:
-  stage: 'runtimes'
-  extends: ['.sdk_template', '.vars_nightly', '.vars_aarch64']
-
-gnome:aarch64:42:
-  stage: 'runtimes'
-  extends: ['.sdk_template', '.vars_42', '.vars_aarch64']
+  tags:
+    - x86_64
+    - crun
+  extends: ['.sdk_template', '.vars_42']


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