forked from varfish-org/varfish-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
45 lines (40 loc) · 1.49 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
image: python:3.6
services:
- postgres:12
- redis:latest
variables:
POSTGRES_DB: varfish_web
POSTGRES_USER: varfish_web
POSTGRES_PASSWORD: varfish_web
DATABASE_URL: postgres://varfish_web:varfish_web@postgres/varfish_web
CELERY_BROKER_URL: redis://redis:6379/0
before_script:
# SSH setup taken from https://gitlab.com/gitlab-examples/ssh-private-key
#
# install ssh-agent
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
# run ssh-agent
- eval $(ssh-agent -s)
# add ssh key stored in SSH_PRIVATE_KEY variable to the agent store
- echo -n "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
# disable host key checking (NOTE: makes you susceptible to man-in-the-middle attacks)
# WARNING: use only in docker container, if you use it with shell you will overwrite your user's ssh config
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
- sh ./utility/install_os_gitlab.sh
- sh ./utility/install_chrome_gitlab.sh
- pip3 install virtualenv
- virtualenv env
- source env/bin/activate
- sh ./utility/install_python_dependencies.sh
all_tests:
script:
# Run tests for Django app.
- python manage.py collectstatic --noinput
- coverage run manage.py test -v2 --settings=config.settings.test
- coverage report
# Run syntax checks and static code analysis.
- black -l 100 --check --exclude '/(\.eggs|\.git|\.hg|\.mypy_cache|\.nox|\.tox|\.?v?env|_build|buck-out|build|dist|src)/' .
# - flake8
when: on_success