Merge branch 'CDB-3079' of https://github.com/CartoDB/CartoDB-SQL-API into CDB-2038

This commit is contained in:
Raul Ochoa 2014-06-04 11:04:59 +02:00
commit 9133893e39
2 changed files with 21 additions and 15 deletions

View File

@ -1,13 +1,19 @@
before_install:
#- sudo apt-add-repository --yes ppa:ubuntugis/ppa
- sudo apt-get update -q
# Removal of postgresql-9.1-postgis-scripts is needed due to a
# bug in some upstream package.
# See http://trac.osgeo.org/ubuntugis/ticket/39
- sudo apt-get remove --purge -q postgresql-9.1-postgis-scripts
- sudo apt-get install -q postgresql-9.1-postgis gdal-bin
- createdb template_postgis
- psql -c "CREATE EXTENSION postgis" template_postgis
before_script:
- lsb_release -a
- sudo mv /etc/apt/sources.list.d/pgdg-source.list* /tmp
- sudo apt-get -qq purge postgis* postgresql*
- sudo rm -Rf /var/lib/postgresql /etc/postgresql
- sudo apt-add-repository --yes ppa:cartodb/postgresql-9.3
- sudo apt-add-repository --yes ppa:cartodb/gis
- sudo apt-get update
- sudo apt-get install -q postgresql-9.3-postgis-2.1
- sudo apt-get install -q postgresql-contrib-9.3
- sudo apt-get install -q postgis
- sudo apt-get install -q gdal-bin
- echo -e "local\tall\tall\ttrust\nhost\tall\tall\t127.0.0.1/32\ttrust\nhost\tall\tall\t::1/128\ttrust" |sudo tee /etc/postgresql/9.3/main/pg_hba.conf
- sudo service postgresql restart
- psql -c 'create database template_postgis;' -U postgres
- psql -c 'CREATE EXTENSION postgis;' -U postgres -d template_postgis
- ./configure
language: node_js

View File

@ -65,18 +65,18 @@ export PGHOST PGPORT
if test x"$PREPARE_PGSQL" = xyes; then
echo "preparing postgres..."
dropdb ${TEST_DB} # 2> /dev/null # error expected if doesn't exist, but not otherwise
createdb -Ttemplate_postgis -EUTF8 ${TEST_DB} || die "Could not create test database"
dropdb -U postgres ${TEST_DB} # 2> /dev/null # error expected if doesn't exist, but not otherwise
createdb -U postgres -Ttemplate_postgis -EUTF8 ${TEST_DB} || die "Could not create test database"
cat test.sql |
sed "s/:PUBLICUSER/${PUBLICUSER}/" |
sed "s/:PUBLICPASS/${PUBLICPASS}/" |
sed "s/:TESTUSER/${TESTUSER}/" |
sed "s/:TESTPASS/${TESTPASS}/" |
psql -v ON_ERROR_STOP=1 ${TEST_DB} || exit 1
psql -U postgres -v ON_ERROR_STOP=1 ${TEST_DB} || exit 1
# TODO: send in a single run, togheter with test.sql
psql -f support/CDB_QueryStatements.sql ${TEST_DB}
psql -f support/CDB_QueryTables.sql ${TEST_DB}
psql -U postgres -f support/CDB_QueryStatements.sql ${TEST_DB}
psql -U postgres -f support/CDB_QueryTables.sql ${TEST_DB}
fi