Jenkinsfile: use pg_virtualenv to isolate test database (#31437)
This commit is contained in:
parent
d361088985
commit
43b3f5ddb1
|
@ -11,4 +11,4 @@ done
|
|||
|
||||
virtualenv venv
|
||||
venv/bin/pip install tox
|
||||
venv/bin/tox -rv
|
||||
pg_virtualenv venv/bin/tox -rv
|
||||
|
|
|
@ -9,13 +9,18 @@ PASSWORD_HASHERS = ['django.contrib.auth.hashers.UnsaltedMD5PasswordHasher'] + l
|
|||
A2_CACHE_ENABLED = False
|
||||
|
||||
LANGUAGE_CODE = 'en'
|
||||
|
||||
DATABASES = {
|
||||
'default': {
|
||||
'ENGINE': os.environ.get('DB_ENGINE', 'django.db.backends.sqlite3'),
|
||||
'TEST': {
|
||||
'NAME': 'a2-test-%s' % os.environ.get("BRANCH_NAME", "").replace('/', '-'),
|
||||
},
|
||||
'NAME': 'authentic2',
|
||||
}
|
||||
}
|
||||
|
||||
if 'postgres' in DATABASES['default']['ENGINE']:
|
||||
for key in ('PGPORT', 'PGHOST', 'PGUSER', 'PGPASSWORD'):
|
||||
if key in os.environ:
|
||||
DATABASES['default'][key[2:]] = os.environ[key]
|
||||
|
||||
|
||||
ALLOWED_HOSTS = ALLOWED_HOSTS + ['example.net', 'cache1.example.com', 'cache2.example.com']
|
||||
|
|
Loading…
Reference in New Issue