Commit 5f9c3ed1 authored by okhin's avatar okhin

Merge branch '164-local_settings-for-postgresql-for-test' into 'master'

Resolve "Local_settings for postgresql for test"

Closes #164 ad allows us to have CI + CD + docs built :)

See merge request !168
parents 822034dc 4699fbeb
Pipeline #174 passed with stage
in 15 minutes and 58 seconds
job test:
script:
- exit 0
- tox
stage: test
tags: [memopol]
......@@ -18,5 +17,6 @@ job install:
- sudo service uwsgi restart memopol
stage: deploy
tags: [memopol]
environment: production
only:
- master
"""
Memopol local settings example.
Edit and rename to local_settings.py to use.
"""
import os
from socket import gethostname
DATA_DIR = 'data'
LOG_DIR = 'log'
PUBLIC_DIR = 'wsgi/static'
DATABASES = {
'default': {
'NAME': os.environ.get('CI_BUILD_REF_NAME'),
'USER': 'memopol_test',
'PASSWORD': 'memopol_test',
'HOST': 'localhost',
'PORT': '5433',
'ENGINE': 'django.db.backends.postgresql_psycopg2',
}
}
ALLOWED_HOSTS = [
gethostname(),
]
SITE_ID = 1
SITE_NAME = 'Memopol'
SITE_DOMAIN = gethostname()
ORGANIZATION_NAME = 'Memopol'
......@@ -7,13 +7,16 @@ setenv =
DJANGO_DEBUG=True
DJANGO_SETTINGS_MODULE=memopol.settings
passenv = *
usedevelop = true
commands =
pip install -U pip
pip install -U setuptools
pip install -Ue {toxinidir}[testing]
{toxinidir}/src/memopol/bin/install_client_deps.sh
cp {toxinidir}/src/memopol/tests/local_settings.py {toxinidir}/src/memopol/local_settings.py
py.test src/
bash -c 'createdb -U memopol_test -p 5433 $CI_BUILD_REF_NAME'
memopol migrate
bash -c 'cat src/representatives/contrib/francedata/tests/representatives_input.json | francedata_import_representatives'
bash -c 'cat src/representatives/contrib/parltrack/tests/representatives_fixture.json | parltrack_import_representatives'
......@@ -22,15 +25,23 @@ commands =
bash -c 'cat src/representatives_votes/contrib/francedata/tests/votes_input.json | francedata_import_votes'
bash -c 'cat src/representatives_votes/contrib/parltrack/tests/dossiers_fixture.json | parltrack_import_dossiers'
bash -c 'cat src/representatives_votes/contrib/parltrack/tests/votes_fixture.json | parltrack_import_votes'
bash -c 'dropdb -U memopol_test -p 5433 $CI_BUILD_REF_NAME'
whitelist_externals =
psql
cp
createdb
dropdb
bash
[testenv:qa]
skipsdist=True
changedir = {toxinidir}
basepython = python2.7
passenv = *
commands =
pip install -U pip
pip install -U setuptools
pip install -Ue {toxinidir}[testing]
flake8 src --exclude '*/migrations,docs,static' --ignore E128
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment