forked from UB-Mannheim/escriptorium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
89 lines (68 loc) · 1.35 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
stages:
- test
- build
- deploy
tests:
stage: test
image: registry.gitlab.com/scripta/escriptorium/base:0.10.0
services:
- postgres:13-alpine
- redis:alpine
variables:
# Databases settings
REDIS_HOST: redis
REDIS_PORT: 6379
SQL_HOST: postgres
POSTGRES_DB: escriptorium
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
# Pip cache
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
cache:
paths:
- .cache/pip
except:
- schedules
script:
- python app/manage.py test -v 2 users api versioning imports core
build:
stage: build
image: node:12-alpine
artifacts:
paths:
- front/dist
expire_in: 2 weeks
before_script:
- cd front
- npm ci
script:
- npm run production
.docker-build:
stage: build
image: docker:19.03.1
services:
- docker:dind
variables:
DOCKER_DRIVER: overlay2
DOCKER_HOST: tcp://docker:2375/
docker-build-app:
extends: .docker-build
script:
- ci/build.sh app
docker-build-exim:
extends: .docker-build
script:
- ci/build.sh exim
docker-build-nginx:
extends: .docker-build
script:
- ci/build.sh nginx
docker-build-base:
extends: .docker-build
# Run this only on base tags
rules:
- if: '$CI_COMMIT_TAG =~ /^base-.*/'
when: on_success
- when: never
script:
- ci/build-base.sh