[gnome-build-meta/valentindavid/publish-oci: 314/314] ci: Publish the OCI images




commit c51f76b76154d956b279f3d87fb35f035646c12b
Author: Valentin David <me valentindavid com>
Date:   Wed Oct 13 14:36:03 2021 +0200

    ci: Publish the OCI images

 .gitlab-ci.yml | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index db9dc2d7d..62786ba8b 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -6,6 +6,8 @@ variables:
   BST_NO_PUSH: "bst --config .gitlab-ci/buildstream-nopush.conf --log-file logs/build.log --colors"
   BST: "bst --config .gitlab-ci/buildstream.conf --log-file logs/build.log --colors"
   FLATPAK_BRANCH: master
+  OCI_BRANCH: master
+  OCI_LATEST_BRANCH: 'false'
   OPENQA_HOST: https://openqa.gnome.org
   OPENQA_NEEDLES_GIT: https://gitlab.gnome.org/gnome/openqa-needles
   OPENQA_NEEDLES_SHA: master
@@ -213,6 +215,35 @@ deploy-flatpak:
     - artifact: flatpak-deploy.yml
       job: generate-deploy-config
 
+deploy-oci:
+  stage: deploy
+  extends:
+  - .x86_64
+  - .deploy-rules
+  needs:
+  - job: 'track'
+    optional: true
+  - job: 'build-x86_64'
+    artifacts: false
+  stage: deploy
+  script:
+  - ${BST} -o arch "${ARCH}" build oci/platform.bst oci/sdk.bst oci/debug.bst
+  - ${BST} -o arch "${ARCH}" checkout --tar oci/platform.bst | podman load
+  - ${BST} -o arch "${ARCH}" checkout --tar oci/sdk.bst | podman load
+  - ${BST} -o arch "${ARCH}" checkout --tar oci/debug.bst | podman load
+  - podman login -u $CI_REGISTRY_USER -p $CI_JOB_TOKEN $CI_REGISTRY
+  - |
+    tags=("${CI_COMMIT_SHORT_SHA}" "${BRANCH}")
+    if [ "${LATEST_BRANCH}" = "true" ]; then
+      tags+=("latest")
+    fi
+    for tag in "${tags[@]}"; do
+      for name in gnome-platform gnome-sdk gnome-sdk-debug; do
+        echo "Uploading ${name}:${tag}"
+        podman push "${CI_REGISTRY_IMAGE}/${name}:${BRANCH}" docker://"${CI_REGISTRY_IMAGE}/${name}:${tag}"
+      done
+    done
+
 vm-image-aarch64:
   extends:
   - .manual-image-template


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