[pitivi/sdk] ci: Replace docker with podman




commit 2d1a69e3c6622adfefea3bf93a0f7290e7abbcbc
Author: Alexandru Băluț <alexandru balut gmail com>
Date:   Sat Dec 5 01:47:06 2020 +0100

    ci: Replace docker with podman
    
    Fixes #2492

 .gitlab-ci.yml | 50 +++++++++++++++++++++++---------------------------
 1 file changed, 23 insertions(+), 27 deletions(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index da94bcc1a..718716a02 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,6 +1,6 @@
 ---
 stages:
-  - docker_image
+  - tests_runner_image
   - build
   - deploy
 
@@ -12,33 +12,29 @@ variables:
 
 
 pitivi:master:
-  stage: docker_image
-  tags:
-    - privileged
-  image: docker:latest
-  variables:
-    DOCKER_DRIVER: overlay2
-    DOCKER_TLS_CERTDIR: ""
-  services:
-    - docker:19.03.0-dind
+  stage: tests_runner_image
+  image: registry.gitlab.gnome.org/infrastructure/docker/buildah:latest
   script:
-    # https://stackoverflow.com/questions/2264428/converting-string-to-lower-case-in-bash#2264537
-    - export NAMESPACE="$(echo "${CI_PROJECT_NAMESPACE}" | tr A-Z a-z)"
-    - export BRANCH=master
-    - export IMAGE="${CI_REGISTRY}/${NAMESPACE}/${CI_PROJECT_NAME}:${BRANCH}-sdk_3.36"
-    - export BASE_IMAGE="registry.gitlab.gnome.org/gnome/gnome-runtime-images/gnome:3.36"
-    - export TMPIMAGENAME="tmp-pitivi-${BRANCH}-sdk_3.36"
-    - export BUILDDIR="\${HOME}/pitivi"
-    - export CLONE_PITIVI="git clone ${CI_PROJECT_URL}.git --single-branch \${HOME}/pitivi -b 
${CI_COMMIT_REF_NAME}"
-    - export BUILD_PITIVI="flatpak-builder --user --disable-rofiles-fuse ${BUILDDIR}/app 
${BUILDDIR}/build/flatpak/org.pitivi.Pitivi.json --state-dir=\${HOME}/flatpak-cache --ccache"
-
+    # https://docs.gitlab.com/ee/ci/variables/predefined_variables.html
     - env
 
-    - docker run --privileged --name ${TMPIMAGENAME} ${BASE_IMAGE} bash -c "${CLONE_PITIVI} && 
${BUILD_PITIVI} && rm -Rf ${BUILDDIR}"
-    - docker commit ${TMPIMAGENAME} ${IMAGE}
-    - docker rm ${TMPIMAGENAME}
-    - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
-    - docker push ${IMAGE}
+    # Create a container for building the sandbox.
+    - export BASE_IMAGE="registry.gitlab.gnome.org/gnome/gnome-runtime-images/gnome:3.38"
+    - podman create -name sandbox_container ${BASE_IMAGE}
+
+    # Build the Pitivi flatpak sandbox in the container.
+    - export DIR=/root/pitivi
+    - podman exec sandbox_container git clone ${CI_PROJECT_URL}.git --single-branch ${DIR} -b 
${CI_COMMIT_REF_NAME}
+    - podman exec sandbox_container flatpak-builder --user --disable-rofiles-fuse ${DIR}/app 
${DIR}/build/flatpak/org.pitivi.Pitivi.json --state-dir=\${HOME}/flatpak-cache --ccache
+    - podman exec sandbox_container rm -rf ${DIR}
+
+    # Turn the live container into a local image.
+    - export IMAGE="registry.gitlab.gnome.org/gnome/pitivi:master-sdk_3.38"
+    - podman commit sandbox_container ${IMAGE}
+
+    # Upload the image.
+    - podman login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
+    - podman push ${IMAGE}
   only:
     - triggers
     - schedules
@@ -49,7 +45,7 @@ build:
   stage: build
   tags:
     - flatpak
-  image: registry.gitlab.gnome.org/gnome/pitivi:master-sdk_3.36
+  image: registry.gitlab.gnome.org/gnome/pitivi:master-sdk_3.38
   variables:
     BLACKLIST: >
       -b tests.test_effects.EffectsPropertiesManagerTest.test_dependent_properties
@@ -100,4 +96,4 @@ deploy:
     - flatpak build-commit-from --src-repo=flatpak_repo /srv/http --timestamp=NOW --gpg-sign=739E841A
   only:
     - master@GNOME/pitivi
-    - thiblahute/sdk3.36@GNOME/pitivi
+    - thiblahute/sdk3.38@GNOME/pitivi


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