forked from pitivi/pitivi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
116 lines (101 loc) · 3.99 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
---
stages:
- docker_image
- build
- deploy
variables:
MANIFEST: build/flatpak/org.pitivi.Pitivi.json
DBUS_ID: org.pitivi.Pitivi
XUNIT_PATH: ${CI_PROJECT_DIR}/xunit.xml
GST_DEBUG_NO_COLOR: "true"
.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.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"
- 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:
stage: build
tags:
- flatpak
image: registry.gitlab.gnome.org/gnome/pitivi:master-sdk_3.36
variables:
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 --disable-rofiles-fuse --filesystem=${BUILDDIR} --filesystem=${CI_PROJECT_DIR} --env=PITIVI_DEVELOPMENT=1 --env=GST_DEBUG=2 --env=GST_DEBUG_NO_COLOR=true --run app ${MANIFEST}"
- export FLATPAK_BUILDER_CACHE="--state-dir=${HOME}/flatpak-cache"
- export FLATPAK_REPO="${CI_PROJECT_DIR}/flatpak_repo"
- env
# Working around the fact that flatpak-builder *requires* the cache dir
# to be on the same filesystem as the build dir
- mv ${CI_PROJECT_DIR} ${BUILDDIR}
- mkdir -p ${CI_PROJECT_DIR}
- cd ${BUILDDIR}
- flatpak-builder --user --disable-rofiles-fuse ${FLATPAK_BUILDER_CACHE} --disable-download --ccache --repo=${FLATPAK_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}
# For some reason GitLab fails to upload directories
- cd ${CI_PROJECT_DIR}/
- tar czf tests-logs.tar.gz tests-logs/
- tar cf flatpak_repo.tar flatpak_repo/
cache:
paths:
- flatpak-cache
artifacts:
expire_in: 30 days
paths:
- xunit.xml
- flatpak_repo.tar
- tests-logs.tar.gz
reports:
junit:
- ${XUNIT_PATH}
deploy:
tags:
- PitiviBuildMachine
stage: deploy
script:
- tar xf flatpak_repo.tar
- flatpak build-commit-from --src-repo=flatpak_repo /srv/http --timestamp=NOW --gpg-sign=739E841A
only:
- master@GNOME/pitivi
- 1.0@GNOME/pitivi
- thiblahute/sdk3.36@GNOME/pitivi