-
Notifications
You must be signed in to change notification settings - Fork 4
/
.gitlab-ci.yml
90 lines (76 loc) · 1.94 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
# GitLab CI/CD Pipeline Configuration file
# https://docs.gitlab.com/ee/ci/yaml/
---
# environment variables - also set in every service for a job
# NB: setting PGHOST will cause the postgres service to fail
variables:
SECRET_KEY: static secret key
SQLALCHEMY_DATABASE_TEST_URI: postgresql://postgres:${POSTGRES_PASSWORD}@postgres/${POSTGRES_DB}
REDIS_URL: redis://redis:6379/0
POSTGRES_DB: portaldb
POSTGRES_PASSWORD: wplatrop
stages:
- test
- deploy
before_script:
- pip install tox
# test templates
.test_template: &test_definition
# track debian stable version of python3
image: python:3.9
script: tox
stage: test
.unit_test_template: &unit_test_definition
<<: *test_definition
services:
- postgres:13
- redis:latest
# test jobs
unit_tests:
variables:
TOXENV: py3
<<: *unit_test_definition
unit_tests_celery_background:
variables:
TOXENV: celery_background
<<: *unit_test_definition
docgen_test:
variables:
TOXENV: docs
<<: *test_definition
i18n_test_eproms:
variables:
TOXENV: translations
PERSISTENCE_DIR: eproms
<<: *unit_test_definition
i18n_test_tnusa:
variables:
TOXENV: translations
PERSISTENCE_DIR: gil
<<: *unit_test_definition
# deploy templates
.i18n_upload_template: &i18n_upload_definition
stage: deploy
# TODO re-enable/remove when future of Smartling integration more certain
# disable Smartling string uploads
when: manual
script:
- tox
# reuse tox virtual environment to also upload translations
- FLASK_APP=manage.py .tox/${TOXENV}/bin/python -m flask translation-upload
# only upload translations from develop branch
only:
refs: [develop]
# deploy jobs
i18n_upload_eproms:
<<: *unit_test_definition
<<: *i18n_upload_definition
variables:
TOXENV: translations
PERSISTENCE_DIR: eproms
i18n_upload_tnusa:
<<: *unit_test_definition
<<: *i18n_upload_definition
variables:
TOXENV: translations
PERSISTENCE_DIR: gil