gestioCOF/.gitlab-ci.yml

41 lines
1.1 KiB
YAML
Raw Normal View History

services:
2017-09-12 00:14:52 +02:00
- postgres:latest
- redis:latest
variables:
# GestioCOF settings
2017-09-12 00:14:52 +02:00
DJANGO_SETTINGS_MODULE: "cof.settings.prod"
DBHOST: "postgres"
REDIS_HOST: "redis"
# 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"
2017-09-30 02:39:45 +02:00
# psql password authentication
PGPASSWORD: $POSTGRES_PASSWORD
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
- sed -E 's/^REDIS_HOST.*/REDIS_HOST = "redis"/' cof/settings/secret_example.py > cof/settings/secret.py
# 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-09-12 00:14:52 +02:00
- pip install --cache-dir vendor/pip -t vendor/python -r requirements.txt
test:
stage: test
script:
2017-09-30 02:39:45 +02:00
- python manage.py test -v3