2016-11-13 11:29:28 +01:00
|
|
|
services:
|
2017-09-12 00:14:52 +02:00
|
|
|
- postgres:latest
|
2016-11-13 11:29:28 +01:00
|
|
|
- redis:latest
|
|
|
|
|
|
|
|
variables:
|
|
|
|
# GestioCOF settings
|
2017-10-27 10:20:11 +02:00
|
|
|
DJANGO_SETTINGS_MODULE: "gestioCOF.settings.prod"
|
2017-09-12 00:14:52 +02:00
|
|
|
DBHOST: "postgres"
|
2016-11-13 11:29:28 +01:00
|
|
|
REDIS_HOST: "redis"
|
2017-10-10 15:26:14 +02:00
|
|
|
REDIS_PASSWD: "dummy"
|
2016-11-13 11:29:28 +01:00
|
|
|
|
|
|
|
# Cached packages
|
|
|
|
PYTHONPATH: "$CI_PROJECT_DIR/vendor/python"
|
|
|
|
|
2017-09-12 00:14:52 +02:00
|
|
|
# postgres service configuration
|
|
|
|
POSTGRES_PASSWORD: "4KZt3nGPLVeWSvtBZPSM3fSzXpzEU4"
|
|
|
|
POSTGRES_USER: "cof_gestion"
|
|
|
|
POSTGRES_DB: "cof_gestion"
|
2016-11-13 11:29:28 +01:00
|
|
|
|
2017-09-30 02:39:45 +02:00
|
|
|
# psql password authentication
|
|
|
|
PGPASSWORD: $POSTGRES_PASSWORD
|
|
|
|
|
2016-11-13 11:29:28 +01:00
|
|
|
cache:
|
|
|
|
paths:
|
|
|
|
- vendor/python
|
|
|
|
- vendor/pip
|
|
|
|
- vendor/apt
|
|
|
|
|
|
|
|
before_script:
|
|
|
|
- mkdir -p vendor/{python,pip,apt}
|
2017-09-12 00:14:52 +02:00
|
|
|
- apt-get update -q && apt-get -o dir::cache::archives="vendor/apt" install -yqq postgresql-client
|
2017-10-27 10:20:11 +02:00
|
|
|
- sed -E 's/^REDIS_HOST.*/REDIS_HOST = "redis"/' gestioCOF/settings/secret_example.py > gestioCOF/settings/secret.py
|
|
|
|
- sed -i.bak -E 's;^REDIS_PASSWD = .*$;REDIS_PASSWD = "";' gestioCOF/settings/secret.py
|
2017-02-13 17:43:10 +01:00
|
|
|
# Remove the old test database if it has not been done yet
|
2017-09-30 02:39:45 +02:00
|
|
|
- psql --username=$POSTGRES_USER --host=$DBHOST -c "DROP DATABASE IF EXISTS test_$POSTGRES_DB"
|
2017-10-10 21:27:15 +02:00
|
|
|
- pip install --upgrade --cache-dir vendor/pip -t vendor/python -r requirements.txt
|
2016-11-13 11:29:28 +01:00
|
|
|
|
|
|
|
test:
|
|
|
|
stage: test
|
|
|
|
script:
|
2017-10-11 23:34:43 +02:00
|
|
|
- python manage.py test
|