Optional database prepare
In some cases nailgun database could already exist
and ready for use. In this case we don't need
to do anything when preparing database.
Change-Id: I865eefd44af0dd1062f27b789d60515d55d7b4d2
(cherry picked from commit a22aee3396
)
This commit is contained in:
parent
4a34114eb1
commit
f7be5549d9
@ -25,14 +25,22 @@ case $1 in
|
||||
cleanup_nailgun_env
|
||||
;;
|
||||
prepare_nailgun_database)
|
||||
prepare_pgpass
|
||||
prepare_database_role
|
||||
prepare_database
|
||||
if [[ "${NAILGUN_DB_PREPARE}" == "yes" ]]; then
|
||||
prepare_pgpass
|
||||
prepare_database_role
|
||||
prepare_database
|
||||
else
|
||||
echo "Preparing database has been skipped due to NAILGUN_DB_PREPARE=${NAILGUN_DB_PREPARE}"
|
||||
fi
|
||||
;;
|
||||
cleanup_nailgun_database)
|
||||
prepare_pgpass
|
||||
cleanup_database
|
||||
cleanup_pgpass
|
||||
if [[ "${NAILGUN_DB_PREPARE}" == "yes" ]]; then
|
||||
prepare_pgpass
|
||||
cleanup_database
|
||||
cleanup_pgpass
|
||||
else
|
||||
echo "Cleaning up database has been skipped due to NAILGUN_DB_PREPARE=${NAILGUN_DB_PREPARE}"
|
||||
fi
|
||||
;;
|
||||
cleanup_nailgun_server)
|
||||
cleanup_server
|
||||
|
@ -66,6 +66,7 @@ EOL
|
||||
}
|
||||
|
||||
prepare_server() {
|
||||
python ${NAILGUN_ROOT}/manage.py dropdb > /dev/null
|
||||
python ${NAILGUN_ROOT}/manage.py syncdb > /dev/null
|
||||
python ${NAILGUN_ROOT}/manage.py loaddefault > /dev/null
|
||||
if test -n "$NAILGUN_FIXTURE_FILES"; then
|
||||
|
1
tox.ini
1
tox.ini
@ -15,6 +15,7 @@ setenv =
|
||||
DB_ROOTPW={env:DB_ROOTPW:insecure_slave}
|
||||
DB_ROOTPGPASS={[base]ARTS}/pgpass
|
||||
|
||||
NAILGUN_DB_PREPARE={env:NAILGUN_DB_PREPARE:yes}
|
||||
NAILGUN_DB={env:NAILGUN_DB:openstack_citest}
|
||||
NAILGUN_DB_HOST={env:NAILGUN_DB_HOST:127.0.0.1}
|
||||
NAILGUN_DB_PORT={env:NAILGUN_DB_PORT:5432}
|
||||
|
Loading…
Reference in New Issue
Block a user