Merge branch 'Elarnon/ci' into 'master'

Lance les tests de gestioCOF sur gitlab-ci



See merge request !116
This commit is contained in:
Martin Pepin 2016-11-14 06:41:27 +01:00
commit 297164aae0
3 changed files with 43 additions and 1 deletions

40
.gitlab-ci.yml Normal file
View file

@ -0,0 +1,40 @@
services:
- mysql:latest
- redis:latest
variables:
# GestioCOF settings
DJANGO_SETTINGS_MODULE: "cof.settings_dev"
DBNAME: "cof_gestion"
DBUSER: "cof_gestion"
DBPASSWD: "cof_password"
DBHOST: "mysql"
REDIS_HOST: "redis"
# Cached packages
PYTHONPATH: "$CI_PROJECT_DIR/vendor/python"
# mysql service configuration
MYSQL_DATABASE: "$DBNAME"
MYSQL_USER: "$DBUSER"
MYSQL_PASSWORD: "$DBPASSWD"
MYSQL_ROOT_PASSWORD: "root_password"
cache:
paths:
- vendor/python
- vendor/pip
- vendor/apt
before_script:
- mkdir -p vendor/{python,pip,apt}
- apt-get update -q && apt-get -o dir::cache::archives="vendor/apt" install -yqq mysql-client
- mysql --user=root --password="$MYSQL_ROOT_PASSWORD" --host="$DBHOST"
-e "GRANT ALL ON test_$DBNAME.* TO '$DBUSER'@'%'"
- pip install --cache-dir vendor/pip -t vendor/python -r requirements-devel.txt
test:
stage: test
script:
- python manage.py test

View file

@ -99,6 +99,7 @@ DATABASES = {
'NAME': os.environ['DBNAME'], 'NAME': os.environ['DBNAME'],
'USER': os.environ['DBUSER'], 'USER': os.environ['DBUSER'],
'PASSWORD': os.environ['DBPASSWD'], 'PASSWORD': os.environ['DBPASSWD'],
'HOST': os.environ.get('DBHOST', 'localhost'),
} }
} }
@ -176,7 +177,7 @@ CHANNEL_LAYERS = {
"default": { "default": {
"BACKEND": "asgi_redis.RedisChannelLayer", "BACKEND": "asgi_redis.RedisChannelLayer",
"CONFIG": { "CONFIG": {
"hosts": [("localhost", 6379)], "hosts": [(os.environ.get("REDIS_HOST", "localhost"), 6379)],
}, },
"ROUTING": "cof.routing.channel_routing", "ROUTING": "cof.routing.channel_routing",
} }

View file

@ -1,2 +1,3 @@
-r requirements.txt
django-debug-toolbar django-debug-toolbar
ipython ipython