[gnome-boxes/wip/feborges/flatpak-ci] ci: Generate a Flatpak bundle for every commit



commit 89319c4e838ae32027b6a6b2054a291373ca44e5
Author: Felipe Borges <felipeborges gnome org>
Date:   Mon May 28 12:00:13 2018 +0200

    ci: Generate a Flatpak bundle for every commit
    
    See https://gitlab.gnome.org/GNOME/gnome-boxes/issues/202

 .gitlab-ci.yml | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 66 insertions(+)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index e62a03b0..1c8e7cfa 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -14,3 +14,69 @@ build:
     script:
         - meson _build .
         - ninja -C _build
+
+# Devops with Flatpak + CI (https://gitlab.gnome.org/GNOME/gnome-boxes/issues/202)
+stages:
+- test
+- review
+
+variables:
+    BUNDLE: "gnome-boxes.flatpak"
+
+flatpak:
+    image: registry.gitlab.gnome.org/gnome/gnome-nightly-oci/nightly:master
+    stage: test
+    variables:
+        # Replace with your manifest path
+        MANIFEST_PATH: "build-aux/flatpak/org.gnome.Boxes.json"
+        RUNTIME_REPO: "https://sdk.gnome.org/gnome-nightly.flatpakrepo";
+        # Replace with your application name, as written in the manifest
+        FLATPAK_MODULE: "gnome-boxes"
+        # Make sure to keep this in sync with the Flatpak manifest, all arguments
+        # are passed except the config-args because we build it ourselves
+        MESON_ARGS: "-Dflatpak=true"
+        DBUS_ID: "org.gnome.Boxes"
+
+    script:
+        - flatpak-builder --stop-at=${FLATPAK_MODULE} app ${MANIFEST_PATH}
+        # Make sure to keep this in sync with the Flatpak manifest, all arguments
+        # are passed except the config-args because we build it ourselves
+        - flatpak build app meson --prefix=/app ${MESON_ARGS} _build
+        - flatpak build app ninja -C _build install
+        - flatpak-builder --finish-only --repo=repo app ${MANIFEST_PATH}
+        # Generate a Flatpak bundle
+        - flatpak build-bundle repo ${BUNDLE} --runtime-repo=${RUNTIME_REPO} ${DBUS_ID}
+    artifacts:
+        paths:
+            - ${BUNDLE}
+            - _build/meson-logs/meson-log.txt
+            - _build/meson-logs/testlog.txt
+        expire_in: 30 days
+    cache:
+        paths:
+             - .flatpak-builder/cache
+
+review:
+    stage: review
+    dependencies:
+        - flatpak
+    script:
+        - echo "Generating flatpak deployment"
+    artifacts:
+        paths:
+            - ${BUNDLE}
+        expire_in: 30 days
+    environment:
+        name: review/$CI_COMMIT_REF_NAME
+        url: https://gitlab.gnome.org/$CI_PROJECT_PATH/-/jobs/$CI_JOB_ID/artifacts/raw/${BUNDLE}
+        on_stop: stop_review
+
+stop_review:
+    stage: review
+    script:
+        - echo "Stopping flatpak deployment"
+    when: manual
+    environment:
+        name: review/$CI_COMMIT_REF_NAME
+        action: stop
+


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