-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
55 lines (51 loc) · 1.36 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
include:
- project: 'liipops/django-hoster'
file: django-hosting.yml
ref: main
variables:
LIIPOPS_HOSTS: swing-defivelo-intranet.k8s.liip.ch
DJANGO_SETTINGS_MODULE: defivelo.settings.base
GUNICORN_APP_NAME: defivelo.wsgi
LIIP_DOCKER_PYTHON_VERSION: "3.11"
BASE_ADDITIONAL_APKS: sassc
HTTPD_RUN_COMPRESS: "true"
stages:
- test
- build
test:
stage: test
rules:
# Always run on default branch
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
# Always run on MRs
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
tags:
- docker-nonswiss-ok
image: &test_image 'python:3.11-bullseye'
services:
- name: postgres:15
alias: db
variables:
GIT_SUBMODULE_STRATEGY: recursive
DJANGO_SETTINGS_MODULE: defivelo.settings.test
DATABASE_URL: postgresql://postgres:postgres@db/postgres
POSTGRES_PASSWORD: postgres
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
cache:
key: *test_image
paths:
- .cache/pip
before_script:
- apt-get update; apt-get --no-install-recommends -y install sassc
script:
- pip install -r requirements/test.txt
- |
bash -c "
echo -n 'Wait until the PostgreSQL server is ready .'
while ! (echo > /dev/tcp/db/5432) >/dev/null 2>&1; do
echo -n '.'
sleep 1
done
echo ' Ready!'
"
- ./scripts/run_tests.sh