-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
.gitlab-ci.yml
110 lines (96 loc) · 2.36 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
image: debian:bullseye
stages:
- test
- deploy
variables:
LC_ALL: C.UTF-8
DEBIAN_FRONTEND: noninteractive
# This template needs to be in text block format since `gitlab-runner
# exec` cannot handle templates in list format.
.apt-template: &apt-template |
set -e
set -x
echo Etc/UTC > /etc/timezone
echo 'quiet "1";' \
'APT::Install-Recommends "0";' \
'APT::Install-Suggests "0";' \
'APT::Acquire::Retries "20";' \
'APT::Get::Assume-Yes "true";' \
'Dpkg::Use-Pty "0";' \
> /etc/apt/apt.conf.d/99gitlab
apt-get update
apt-get dist-upgrade
.setup-template: &setup-template
- *apt-template
- apt-get install
curl
fdroidserver
git
python3-babel
python3-bleach
python3-cryptography
python3-django-allauth
python3-django-compressor
python3-django-modeltranslation
python3-django-sass-processor
python3-dockerpycreds
python3-libcloud
python3-libsass
python3-magic
python3-pip
python3-psycopg2
python3-qrcode
python3-rcssmin
python3-rjsmin
python3-setuptools
python3-websocket
python3-webview
python3-wheel
rsync
pycodestyle:
stage: test
script:
- *apt-template
- apt-get install pycodestyle
- ./tests/test-pep8.sh
pylint:
stage: test
before_script:
- *setup-template
- pip3 install -r requirements.txt
- pip3 install -r requirements-dev.txt
script:
- ./tests/test-pylint.sh
units:
stage: test
cache:
paths:
- /usr/local/lib/python*/dist-packages
- node_modules
before_script:
- *setup-template
- apt-get install npm
- ./setup.sh
- pip3 install -r requirements-dev.txt
- npm install --user
script:
- ./tests/test-units.sh
docker:
stage: deploy
image: docker:git
services:
- docker:dind
before_script:
- echo $CI_BUILD_TOKEN | docker login -u gitlab-ci-token --password-stdin registry.gitlab.com
script:
- docker build -t $CI_REGISTRY_IMAGE:latest .
- docker tag $CI_REGISTRY_IMAGE:latest $CI_REGISTRY_IMAGE:bullseye
- docker tag $CI_REGISTRY_IMAGE:latest $CI_REGISTRY_IMAGE:django-2
- docker push $CI_REGISTRY_IMAGE:latest
- docker push $CI_REGISTRY_IMAGE:bullseye
- docker push $CI_REGISTRY_IMAGE:django-2
when: on_success
only:
- master
environment:
name: docker