From 46ba38aa5fb9f5636b4a69d76667f962994d7c80 Mon Sep 17 00:00:00 2001 From: Raul Ochoa Date: Tue, 3 Jun 2014 15:18:14 +0200 Subject: [PATCH 1/8] try to use postg(res|is)-9.3 instead of 9.1 --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 45a2ba3c..ad3d11b1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,8 +4,8 @@ before_install: # 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 + - sudo apt-get remove --purge -q postgresql-9.3-postgis-scripts + - sudo apt-get install -q postgresql-9.3-postgis gdal-bin - createdb template_postgis - psql -c "CREATE EXTENSION postgis" template_postgis - ./configure From 88438c4ba51a77625ed5d940288b68f49ad2efec Mon Sep 17 00:00:00 2001 From: Raul Ochoa Date: Tue, 3 Jun 2014 15:45:01 +0200 Subject: [PATCH 2/8] CDB-3079 simplify installation relying on default postg(res|is) --- .travis.yml | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index ad3d11b1..1008c932 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,13 +1,7 @@ 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.3-postgis-scripts - - sudo apt-get install -q postgresql-9.3-postgis gdal-bin - - createdb template_postgis - - psql -c "CREATE EXTENSION postgis" template_postgis + - psql -c 'create database template_postgis;' -U postgres + - psql -c 'CREATE EXTENSION postgis;' -U postgres -d template_postgis + - psql -c 'CREATE EXTENSION postgis_topology;' -U postgres -d template_postgis - ./configure language: node_js From d31a0a01d58d9df01acf2cc5ebd202a7b277ecce Mon Sep 17 00:00:00 2001 From: Raul Ochoa Date: Tue, 3 Jun 2014 16:15:31 +0200 Subject: [PATCH 3/8] CDB-3079 uses addons as per http://docs.travis-ci.com/user/using-postgresql/ --- .travis.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1008c932..39c68b22 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,9 @@ -before_install: +addons: + postgresql: "9.3" + +before_script: - psql -c 'create database template_postgis;' -U postgres - psql -c 'CREATE EXTENSION postgis;' -U postgres -d template_postgis - - psql -c 'CREATE EXTENSION postgis_topology;' -U postgres -d template_postgis - ./configure language: node_js From f2b8bf793d15d78550016184c58dce9888343d4a Mon Sep 17 00:00:00 2001 From: Raul Ochoa Date: Tue, 3 Jun 2014 17:31:52 +0200 Subject: [PATCH 4/8] CDB-3079 installs gdal --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 39c68b22..5b7f84b7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,6 +2,7 @@ addons: postgresql: "9.3" before_script: + - sudo apt-get install -q gdal-bin - psql -c 'create database template_postgis;' -U postgres - psql -c 'CREATE EXTENSION postgis;' -U postgres -d template_postgis - ./configure From b109343a256d7d524512cad7f8e53468740d9fdd Mon Sep 17 00:00:00 2001 From: Raul Ochoa Date: Tue, 3 Jun 2014 17:53:06 +0200 Subject: [PATCH 5/8] CDB-3079 tries to use cartodb flavour of postgres/postgis --- .travis.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5b7f84b7..cd86b68b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,9 @@ -addons: - postgresql: "9.3" - before_script: - sudo apt-get install -q gdal-bin + - 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 - psql -c 'create database template_postgis;' -U postgres - psql -c 'CREATE EXTENSION postgis;' -U postgres -d template_postgis - ./configure From c38ff94492327d0ef0983bfa5a7f59a81f4ff7dd Mon Sep 17 00:00:00 2001 From: Raul Ochoa Date: Tue, 3 Jun 2014 18:11:32 +0200 Subject: [PATCH 6/8] CDB-3079 yet another try to use cartodb flavour of postgres/postgis --- .travis.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index cd86b68b..6d6f2893 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,9 +1,17 @@ before_script: - - sudo apt-get install -q gdal-bin + - 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 From 277a34cb8381e8da4fa2ce92d04c158618822c0a Mon Sep 17 00:00:00 2001 From: Raul Ochoa Date: Tue, 3 Jun 2014 18:33:40 +0200 Subject: [PATCH 7/8] CDB-3079 enforces postgres user in preparation script --- test/prepare_db.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/prepare_db.sh b/test/prepare_db.sh index 324bdc46..b4f075c9 100755 --- a/test/prepare_db.sh +++ b/test/prepare_db.sh @@ -65,8 +65,8 @@ 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}/" | From 987b3e03182382e26f46f51c2934055c89b2f94b Mon Sep 17 00:00:00 2001 From: Raul Ochoa Date: Tue, 3 Jun 2014 18:49:29 +0200 Subject: [PATCH 8/8] CDB-3079 enforces postgres user in preparation script --- test/prepare_db.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/prepare_db.sh b/test/prepare_db.sh index b4f075c9..3c130510 100755 --- a/test/prepare_db.sh +++ b/test/prepare_db.sh @@ -72,11 +72,11 @@ if test x"$PREPARE_PGSQL" = xyes; then 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