forked from yoe/SReview
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
223 lines (201 loc) · 5 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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
---
stages:
- test
- deb
#- autopkgtest
- docker-pre
- docker
- docker-post
#- dockertest
- release
.build: &build
stage: test
services:
- postgres:9.6
- name: minio/minio:latest
command:
- server
- /data
variables:
POSTGRES_DB: sreview
POSTGRES_USER: sreview
POSTGRES_PASSWORD: ""
POSTGRES_HOST_AUTH_METHOD: trust
SREVIEWTEST_DB: sreview;host=postgres;user=sreview
SREVIEWTEST_S3_CONFIG: '{"default":{"aws_access_key_id":"minioadmin","aws_secret_access_key":"minioadmin","secure":0,"host":"minio-minio:9000"}}'
SREVIEWTEST_BUCKET: 'test'
SREVIEW_COMMAND_TUNE: '{"bs1770gain":"0.5","inkscape":"0.9"}'
image: $CI_JOB_NAME
before_script:
- apt-get update; apt-get -y --no-install-recommends install inkscape ffmpeg bs1770gain
- cpanm ExtUtils::Depends
- cpanm --notest --installdeps .
- perl Makefile.PL
- perl .ci/setup-minio.pl
script:
- make TEST_VERBOSE=1 test
tags:
- docker
perl:latest:
<<: *build
perl:5.24:
<<: *build
.deb: &deb
stage: deb
image: $CI_JOB_NAME
before_script:
- apt-get update; apt-get -y --no-install-recommends install devscripts equivs git build-essential
- mk-build-deps -r -i -t "apt-get -y -o Debug::pkgProblemResolver=yes --no-install-recommends"
script:
- dpkg-buildpackage -us -uc -i -I.git
after_script:
- mkdir products
- dcmd mv ../*ges products/
- echo "GIT_DESCRIBE=$(git describe)" > dot.env
artifacts:
paths:
- products
reports:
dotenv: dot.env
tags:
- docker
#debian:stable:
# <<: *deb
debian:testing:
<<: *deb
debian:unstable:
<<: *deb
allow_failure: true
.docker: &docker
stage: docker
dependencies:
- debian:testing
services:
- docker:dind
image: docker:stable
tags:
- docker
before_script:
- export IMAGE_TAG=$CI_REGISTRY_IMAGE/${CI_JOB_NAME#*:}:$CI_COMMIT_REF_SLUG
- cp products/*deb dockerfiles/${CI_JOB_NAME#*:}
- docker info
- docker pull $IMAGE_TAG || true
script:
- cd dockerfiles/${CI_JOB_NAME#*:}
- sed -i -e "s/@git_describe@/$GIT_DESCRIBE/g" Dockerfile
- docker build --build-arg=ci_registry_image=$CI_REGISTRY_IMAGE --build-arg=ci_commit_ref_slug=$CI_COMMIT_REF_SLUG --cache-from $CI_REGISTRY_IMAGE/master:$CI_COMMIT_REF_SLUG --cache-from $IMAGE_TAG --pull -t $IMAGE_TAG .
after_script:
- export IMAGE_TAG=$CI_REGISTRY_IMAGE/${CI_JOB_NAME#*:}:$CI_COMMIT_REF_SLUG
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker push $IMAGE_TAG
docker:common:
<<: *docker
stage: docker-pre
needs:
- debian:testing
docker:encoder:
<<: *docker
needs:
- debian:testing
- docker:common
docker:detect:
<<: *docker
needs:
- debian:testing
- docker:common
docker:master-kube:
<<: *docker
stage: docker-post
needs:
- debian:testing
- docker:master
- docker:common
docker:master:
<<: *docker
needs:
- debian:testing
- docker:common
docker:web:
<<: *docker
needs:
- debian:testing
- docker:common
.drelease: &drelease
stage: release
when: manual
services:
- docker:dind
image: docker:stable
tags:
- docker
script:
- docker pull $CI_REGISTRY_IMAGE/${CI_JOB_NAME#*:}:$CI_COMMIT_REF_SLUG
- docker tag $CI_REGISTRY_IMAGE/${CI_JOB_NAME#*:}:$CI_COMMIT_REF_SLUG $CI_REGISTRY_IMAGE/${CI_JOB_NAME#*:}:latest
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker push $CI_REGISTRY_IMAGE/${CI_JOB_NAME#*:}:latest
release:encoder:
<<: *drelease
release:master:
<<: *drelease
release:master-kube:
<<: *drelease
release:web:
<<: *drelease
release:detect:
<<: *drelease
pages:
stage: release
dependencies:
- debian:testing
script:
- mkdir public
- apt-get update; apt-get -y --no-install-recommends install devscripts
- dcmd cp products/*.changes public/
- for i in public/*.deb; do ln -s $(basename $i) ${i%_${i#*_}}.deb; done
artifacts:
paths:
- public
only:
- main
needs:
- debian:testing
#validate:package:
# image: debian:unstable
# dependencies:
# - debian:unstable
# needs:
# - debian:unstable
# before_script:
# - apt-get update
# - apt-get -y install autopkgtest
# stage: autopkgtest
# services:
# - postgres:latest
# variables:
# POSTGRES_DB: sreview
# POSTGRES_USER: sreview
# POSTGRES_PASSWORD: ""
# POSTGRES_HOST_AUTH_METHOD: trust
# SREVIEW_DBISTRING: '"dbi:Pg:dbname=sreview;host=postgres;user=sreview"'
# script:
# - autopkgtest products/*ges -- null
#validate:web:
# allow_failure: true
# stage: dockertest
# services:
# - name: postgres:latest
# alias: postgresql
# - name: $CI_REGISTRY_IMAGE/web:$CI_COMMIT_REF_SLUG
# alias: web
# variables:
# POSTGRES_USER: sreview
# POSTGRES_DB: sreview
# POSTGRES_PASSWORD: ""
# POSTGRES_HOST_AUTH_METHOD: trust
# SREVIEW_DBISTRING: '"dbi:Pg:dbname=sreview;host=postgresql;user=sreview"'
# SREVIEW_ADMINUSER: '"[email protected]"'
# SREVIEW_ADMINPW: '"foo"'
# SREVIEW_URLBASE: '"http://web:8080/"'
# image: $CI_REGISTRY_IMAGE/encoder:$CI_COMMIT_REF_SLUG
# script:
# - perl -I lib dockerfiles/tests/test.pl