From e454c3f923948dd1f683e3bb6041833d1a6a2570 Mon Sep 17 00:00:00 2001 From: Denis Rouzaud Date: Fri, 2 Feb 2018 11:20:51 -0400 Subject: [PATCH] roles are created on demand --- .travis.yml | 2 +- scripts/db_setup.sh | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0f4a96ed..b46ae408 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,7 +29,7 @@ before_script: - psql -c 'CREATE EXTENSION hstore;' -U postgres -d qgep script: - - $TRAVIS_BUILD_DIR/scripts/db_setup.sh > /dev/null + - $TRAVIS_BUILD_DIR/scripts/db_setup.sh -r > /dev/null - nosetests after_success: diff --git a/scripts/db_setup.sh b/scripts/db_setup.sh index bbd16905..2969d76a 100755 --- a/scripts/db_setup.sh +++ b/scripts/db_setup.sh @@ -26,11 +26,14 @@ then PGSERVICE=pg_qgep fi -while getopts ":fs:p:" opt; do +while getopts ":rfs:p:" opt; do case $opt in f) force=True ;; + r) + roles=True + ;; s) SRID=$OPTARG echo "-s was triggered, SRID: $SRID" >&2 @@ -95,4 +98,6 @@ psql "service=${PGSERVICE}" -v ON_ERROR_STOP=1 -c "$(${DIR}/view/vw_oo_organisat psql "service=${PGSERVICE}" -v ON_ERROR_STOP=1 -v SRID=$SRID -f ${DIR}/view/vw_catchment_area_connections.sql psql "service=${PGSERVICE}" -v ON_ERROR_STOP=1 -v SRID=$SRID -f ${DIR}/view/vw_change_points.sql -psql "service=${PGSERVICE}" -v ON_ERROR_STOP=1 -f ${DIR}/12_roles.sql +if [[ $roles ]]; then + psql "service=${PGSERVICE}" -v ON_ERROR_STOP=1 -f ${DIR}/12_roles.sql +fi