Skip to content

Commit

Permalink
Merge pull request #62 from QGEP/optional_roles
Browse files Browse the repository at this point in the history
roles are created on demand
  • Loading branch information
3nids authored Feb 2, 2018
2 parents ff3bb2d + e454c3f commit 611c762
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
9 changes: 7 additions & 2 deletions scripts/db_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

0 comments on commit 611c762

Please sign in to comment.