[gtranslator] CI: Initial gitlab-ci



commit e433c7b9b1c24fe46512e84bd8ca88b58c01d102
Author: Daniel GarcĂ­a Moreno <danigm wadobo com>
Date:   Wed Sep 5 20:52:43 2018 +0200

    CI: Initial gitlab-ci

 .gitlab-ci.yml | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 68 insertions(+)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 00000000..4fd9c08e
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,68 @@
+stages:
+  - test
+  - review
+
+variables:
+    BUNDLE: "org.gnome.GtranslatorDevel.flatpak"
+    MANIFEST_PATH: "build-aux/flatpak/org.gnome.Gtranslator.json"
+    FLATPAK_MODULE: "gtranslator"
+    DBUS_ID: "org.gnome.GtranslatorDevel"
+
+.flatpak_cache_template: &flatpak_cache
+    cache:
+        key: "flatpak"
+        paths:
+          - .flatpak-builder/cache/
+
+
+flatpak:
+    image: "registry.gitlab.gnome.org/gnome/gnome-runtime-images/gnome:master"
+    stage: "test"
+    script:
+        - flatpak-builder --stop-at=${FLATPAK_MODULE} --force-clean app ${MANIFEST_PATH}
+
+        # Build the flatpak repo
+        - flatpak-builder --run app ${MANIFEST_PATH} meson --prefix=/app -Dprofile=development _build
+        - flatpak-builder --run app ${MANIFEST_PATH} ninja -C _build install
+
+        # Create a flatpak bundle
+        - flatpak-builder --finish-only app ${MANIFEST_PATH}
+        - flatpak build-export repo app
+        - flatpak build-bundle repo ${BUNDLE} ${DBUS_ID}
+
+    artifacts:
+        paths:
+            - "${BUNDLE}"
+        expire_in: 30 days
+    <<: *flatpak_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
+    except:
+        - master@GNOME/gtranslator
+        - tags
+
+stop_review:
+    stage: review
+    script:
+        - echo "Stopping flatpak deployment"
+    when: manual
+    environment:
+        name: "review/${CI_COMMIT_REF_NAME}"
+        action: stop
+    except:
+        - master@GNOME/gtranslator
+        - tags


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