-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.gitlab-ci.yml
84 lines (76 loc) · 1.88 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
image: registry.gitlab.com/berniwittmann/beachanmeldung:latest
services:
- postgres:latest
stages:
- lint
- test
- deploy
variables:
SECRET_KEY: test-secret
POSTGRES_DB: beachtest
POSTGRES_USER: beachtest
POSTGRES_PASSWORD: beachtest
LANGUAGE_CODE: en-us
TIME_ZONE: Europe/Berlin
DEFAULT_EMAIL_FROM: [email protected]
SERVER_EMAIL: [email protected]
backend_tests:
stage: test
before_script:
- export SECRET_KEY=test-secret
- export DATABASE_NAME=beachtest
- export DATABASE_USER=beachtest
- export DATABASE_PASSWORD=beachtest
- export DATABASE_HOST=postgres
- source /app/venv/bin/activate
script:
- SECRET_KEY=test-secret coverage run manage.py test
after_script:
- source /app/venv/bin/activate
- coverage report
- coverage html
artifacts:
paths:
- htmlcov
expire_in: 4 weeks
backend_lint:
stage: lint
before_script:
- source /app/venv/bin/activate
script:
- flake8
frontend_tests:
stage: test
before_script:
- cd web/vueapp
- cp -R /app/node_modules .
script:
- npm run test
artifacts:
paths:
- web/vueapp/test/unit/reports
- web/vueapp/test/unit/coverage
expire_in: 4 weeks
frontend_lint:
stage: lint
before_script:
- cd web/vueapp
- cp -R /app/node_modules .
script:
- npm run lint
deploy:
stage: deploy
before_script:
- gem install dpl
- source /app/venv/bin/activate
script:
- npm run build
- source /app/venv/bin/activate
- python manage.py collectstatic --noinput
- python manage.py compilemessages
- dpl --provider=heroku --app=beachanmeldung --api-key=$HEROKU_API_KEY --skip_cleanup
environment:
name: production
url: https://beachanmeldung.herokuapp.com
only:
- tags