ci: use $BUILD_TAG to create database name (#.....)

This commit is contained in:
Frédéric Péters 2023-02-20 19:15:04 +01:00
parent 80d7fb2fbb
commit 234a4dcec7
2 changed files with 3 additions and 2 deletions

View File

@ -4,7 +4,7 @@ DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'TEST': {
'NAME': 'bidon-test-%s' % os.environ.get("BRANCH_NAME", "").replace('/', '-')[:63],
'NAME': ('bidon-test-%s' % os.environ.get("BUILD_TAG", "").replace('%2', '-').removeprefix('jenkins-'))[:63],
},
}
}

View File

@ -1,5 +1,5 @@
[tox]
toxworkdir = {env:TMPDIR:/tmp}/tox-{env:USER}/bidon/{env:BRANCH_NAME:}
toxworkdir = {env:TMPDIR:/tmp}/tox-{env:USER}/bidon/{env:BUILD_TAG:}
envlist = py3-django22-coverage-junit
[testenv]
@ -7,6 +7,7 @@ usedevelop = True
setenv =
DJANGO_SETTINGS_MODULE=bidon.settings
BIDON_SETTINGS_FILE=tests/settings.py
BUILD_TAG={env:BUILD_TAG:}
BRANCH_NAME={env:BRANCH_NAME:}
coverage: COVERAGE=--cov-report xml --cov-report html --cov=bidon/
junit: JUNIT=--junitxml=junit-{envname}.xml