From 12977507d9807cc7cafb224badee71d8c671abd5 Mon Sep 17 00:00:00 2001 From: Stefan Verhoeven Date: Sat, 17 Feb 2018 13:54:15 +0100 Subject: [PATCH] Install observatory extension Config still points to global common data instead of local observatory --- Dockerfile | 5 +++++ geocoder.sh | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/Dockerfile b/Dockerfile index 8f74089..1ff5d73 100644 --- a/Dockerfile +++ b/Dockerfile @@ -209,6 +209,11 @@ RUN git clone https://github.com/CartoDB/data-services.git && \ pip install -r requirements.txt && pip install . && \ cd ../../../../client && PGUSER=postgres make install +# Observertory extension +RUN cd / && git clone --recursive https://github.com/CartoDB/observatory-extension.git && \ + cd observatory-extension && \ + PGUSER=postgres make deploy + # Copy confs ADD ./config/CartoDB-dev.js \ /CartoDB-SQL-API/config/environments/development.js diff --git a/geocoder.sh b/geocoder.sh index f17d474..400f8ab 100644 --- a/geocoder.sh +++ b/geocoder.sh @@ -15,6 +15,15 @@ rake cartodb:db:set_unlimited_table_quota[geocoder] GEOCODER_DB=`echo "SELECT database_name FROM users WHERE username='geocoder'" | psql -U postgres -t carto_db_development` psql -U postgres $GEOCODER_DB < /cartodb/script/geocoder_server.sql +# Import observatory test dataset +psql -U postgres -d $GEOCODER_DB -f /observatory-extension/src/pg/test/fixtures/load_fixtures.sql +# Setup permissions for observatory +psql -U postgres -d $GEOCODER_DB -c "BEGIN;CREATE EXTENSION IF NOT EXISTS observatory VERSION 'dev'; COMMIT" -e +psql -U postgres -d $GEOCODER_DB -c "BEGIN;GRANT SELECT ON ALL TABLES IN SCHEMA cdb_observatory TO geocoder; COMMIT" -e +psql -U postgres -d $GEOCODER_DB -c "BEGIN;GRANT EXECUTE ON ALL FUNCTIONS IN SCHEMA cdb_observatory TO geocoder; COMMIT" -e +psql -U postgres -d $GEOCODER_DB -c "BEGIN;GRANT SELECT ON ALL TABLES IN SCHEMA observatory TO geocoder; COMMIT" -e +psql -U postgres -d $GEOCODER_DB -c "BEGIN;GRANT EXECUTE ON ALL FUNCTIONS IN SCHEMA observatory TO geocoder; COMMIT" -e + # Setup dataservices client # dev user USER_DB=`echo "SELECT database_name FROM users WHERE username='dev'" | psql -U postgres -t carto_db_development`