[pitivi/sdk] ci: Fix build



commit 8be5d26d30f311ddbd2f09aa305b66e1567800e3
Author: Alexandru Băluț <alexandru balut gmail com>
Date:   Thu Feb 20 07:59:39 2020 +0100

    ci: Fix build
    
    See https://mail.gnome.org/archives/desktop-devel-list/2020-February/msg00055.html

 .gitlab-ci.yml          | 118 +++++++++++++++++++++++++-----------------------
 .pre-commit-config.yaml |  62 +++++++++++++++----------
 2 files changed, 100 insertions(+), 80 deletions(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 40a42326..0dec5673 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,3 +1,4 @@
+---
 stages:
   - docker_image
   - build
@@ -8,44 +9,93 @@ variables:
   DBUS_ID: org.pitivi.Pitivi
   XUNIT_PATH: ${CI_PROJECT_DIR}/xunit.xml
 
+
+.docker_image_template:
+  tags:
+    - privileged
+  image: docker:latest
+  variables:
+    DOCKER_DRIVER: overlay2
+    DOCKER_TLS_CERTDIR: ""
+  services:
+    - docker:19.03.0-dind
+  script:
+    - export IMAGE="${CI_REGISTRY}/${NAMESPACE}/${CI_PROJECT_NAME}:${BRANCH}-sdk_3.34"
+    - export BASE_IMAGE="registry.gitlab.gnome.org/gnome/gnome-runtime-images/gnome:3.34"
+    - export TMPIMAGENAME="tmp-pitivi-${BRANCH}-sdk_3.34"
+    - 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"
+
+    - 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}
+  only:
+    - triggers
+    - schedules
+  retry: 1
+
+pitivi:master:
+  stage: docker_image
+  extends: .docker_image_template
+  before_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
+
+pitivi:1.0:
+  stage: docker_image
+  extends: .docker_image_template
+  before_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=1.0
+
+
 build:
-  image: registry.gitlab.gnome.org/gnome/pitivi:master-sdk_3.34
   stage: build
-  artifacts:
-    paths:
-      - xunit.xml
+  tags:
+    - flatpak
+  image: registry.gitlab.gnome.org/gnome/pitivi:master-sdk_3.34
   variables:
-    GST_DEBUG_COLOR: 'no'
     BLACKLIST: >
       -b tests.test_effects.EffectsPropertiesManagerTest.test_dependent_properties
   script:
     - export BUILDDIR=${HOME}/pitivi
     - export MANIFEST=${BUILDDIR}/build/flatpak/org.pitivi.Pitivi.json
-    - export RUN_IN_SANDBOX="flatpak-builder --filesystem=${BUILDDIR} --filesystem=${CI_PROJECT_DIR} 
--env=PITIVI_DEVELOPMENT=1 --env=GST_DEBUG=2 --run app ${MANIFEST}"
+    - export RUN_IN_SANDBOX="flatpak-builder --disable-rofiles-fuse --filesystem=${BUILDDIR} 
--filesystem=${CI_PROJECT_DIR} --env=PITIVI_DEVELOPMENT=1 --env=GST_DEBUG=2 --env=GST_DEBUG_COLOR=no --run 
app ${MANIFEST}"
+    - export FLATPAK_BUILDER_CACHE="--state-dir=${HOME}/flatpak-cache"
+
+    - env
 
     # Working around the fact that flatpak-builder *requires* the cache dir
     # to be on the same filesystem as the build dir
-    - export FLATPAK_BUILDER_CACHE="--state-dir=${HOME}/flatpak-cache"
     - mv ${CI_PROJECT_DIR} ${BUILDDIR}
     - mkdir -p ${CI_PROJECT_DIR}
 
     - cd ${BUILDDIR}
-    - flatpak-builder ${FLATPAK_BUILDER_CACHE} --ccache --repo=${CI_PROJECT_DIR}/repo --force-clean app 
build/flatpak/org.pitivi.Pitivi.json --subject="Rolling update for pitivi master" --body="See ${CI_JOB_URL}"
+    - flatpak-builder --user --disable-rofiles-fuse ${FLATPAK_BUILDER_CACHE} --disable-download --ccache 
--repo=${CI_PROJECT_DIR}/repo --force-clean app build/flatpak/org.pitivi.Pitivi.json --subject="Rolling 
update for pitivi master" --body="See ${CI_JOB_URL}"
     - ${RUN_IN_SANDBOX} meson mesonbuild/
     - ${RUN_IN_SANDBOX} ninja -C mesonbuild/
     - xvfb-run -n 32 -s "-screen 0 640x480x24" ${RUN_IN_SANDBOX} gst-validate-launcher 
$PWD/tests/ptv_testsuite.py --dump-on-failure --timeout-factor 4 --xunit-file ${XUNIT_PATH} 
--logs-dir=${CI_PROJECT_DIR}/tests-logs ${BLACKLIST}
   cache:
     paths:
-    - flatpak-cache
+      - flatpak-cache
   artifacts:
     expire_in: 30 days
     paths:
-    - repo/
-    - tests-logs/
+      - xunit.xml
+      - repo/
+      - tests-logs/
     reports:
       junit:
         - ${XUNIT_PATH}
 
+
 deploy:
   tags:
     - PitiviBuildMachine
@@ -56,49 +106,3 @@ deploy:
     - master@GNOME/pitivi
     - 1.0@GNOME/pitivi
     - thiblahute/sdk3.34@GNOME/pitivi
-
-# Not using a Dockerfile because we need the container to be privileged to run flatpak inside of it
-# and it is not possible to use a privileged `docker build`.
-.build_emplate: &build_docker_image
-    image: docker:latest
-    variables:
-        DOCKER_DRIVER: overlay2
-        DOCKER_TLS_CERTDIR: ""
-    services:
-        - docker:19.03.0-dind
-    script:
-        - export IMAGE="${CI_REGISTRY}/${NAMESPACE}/${CI_PROJECT_NAME}:${BRANCH}-sdk_3.34"
-        - export BASE_IMAGE="registry.gitlab.gnome.org/gnome/gnome-runtime-images/gnome:3.34"
-        - export TMPIMAGENAME="tmp-pitivi-${BRANCH}-sdk_3.34"
-        - export RUN_IN_SANDBOX="flatpak-builder --filesystem=${BUILDDIR} --filesystem=${CI_PROJECT_DIR} 
--env=PITIVI_DEVELOPMENT=1 --run app ${MANIFEST}"
-        - 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 ${BUILDDIR}/app 
${BUILDDIR}/build/flatpak/org.pitivi.Pitivi.json --state-dir=\${HOME}/flatpak-cache --ccache"
-
-        - 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}
-    only:
-        - triggers
-        - schedules
-    retry: 1
-
-pitivi:master:
-    stage: docker_image
-    before_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
-    <<: *build_docker_image
-
-pitivi:1.0:
-    stage: docker_image
-    before_script:
-        # https://stackoverflow.com/questions/2264428/converting-string-to-lower-case-in-bash#2264537
-        - export BRANCH=1.0
-        - export NAMESPACE="$(echo "${CI_PROJECT_NAMESPACE}" | tr A-Z a-z)"
-    <<: *build_docker_image
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index f9148d48..17a758c4 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -1,42 +1,58 @@
+---
 repos:
--   repo: https://github.com/pre-commit/pre-commit.git
+  - repo: https://github.com/pre-commit/pre-commit.git
     rev: v1.20.0
     hooks:
-    -   id: validate_manifest
--   repo: https://github.com/pre-commit/pre-commit-hooks.git
+      - id: validate_manifest
+  - repo: https://github.com/pre-commit/pre-commit-hooks.git
     rev: v2.4.0
     hooks:
-    # Hooks able to fix small things.
-    -   id: trailing-whitespace
-    -   id: end-of-file-fixer
+      - id: check-yaml
+      # Hooks able to fix small things.
+      - id: trailing-whitespace
+      - id: end-of-file-fixer
         exclude: ".svg$|.po$"
-    -   id: fix-encoding-pragma
-    # Hooks doing lightweight Python checks.
-    -   id: check-docstring-first
-    -   id: debug-statements
--   repo: https://github.com/asottile/reorder_python_imports.git
+      - id: fix-encoding-pragma
+      # Hooks doing lightweight Python checks.
+      - id: check-docstring-first
+      - id: debug-statements
+  - repo: https://github.com/asottile/reorder_python_imports.git
     rev: v1.8.0
     hooks:
-    -   id: reorder-python-imports
--   repo: https://github.com/pycqa/pydocstyle
+      - id: reorder-python-imports
+  - repo: https://github.com/pycqa/pydocstyle
     rev: 5.0.1
     hooks:
-    -   id: pydocstyle
+      - id: pydocstyle
         args:
-        # http://www.pydocstyle.org/en/latest/error_codes.html
-        -   --ignore=D1,D203,D213,D401,D406,D407,D413
--   repo: https://gitlab.com/PyCQA/flake8
+          # http://www.pydocstyle.org/en/latest/error_codes.html
+          - --ignore=D1,D203,D213,D401,D406,D407,D413
+  - repo: https://gitlab.com/PyCQA/flake8
     rev: 3.7.9
     hooks:
-    -   id: flake8
+      - id: flake8
         args:
-        # http://flake8.pycqa.org/en/latest/user/error-codes.html
-        # https://pycodestyle.readthedocs.io/en/latest/intro.html#error-codes
-        -   --ignore=E402,E501,E722,F401,F841,W504
--   repo: local
+          # http://flake8.pycqa.org/en/latest/user/error-codes.html
+          # https://pycodestyle.readthedocs.io/en/latest/intro.html#error-codes
+          - --ignore=E402,E501,E722,F401,F841,W504
+  - repo: local
     hooks:
-    -   id: pylint
+      - id: pylint
         name: pylint
         entry: python3 -m pylint.__main__ --rcfile=pylint.rc
         language: system
         types: [python]
+  - repo: https://github.com/adrienverge/yamllint.git
+    rev: v1.20.0
+    hooks:
+      - id: yamllint
+        args:
+          - -d
+          - "{extends: default, rules: {line-length: disable}}"
+  - repo: https://gitlab.com/devopshq/gitlab-ci-linter
+    rev: v1.0.0
+    hooks:
+      - id: gitlab-ci-linter
+        args:
+          - '--server'
+          - 'https://gitlab.gnome.org'


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