Windshaft-cartodb/test/prepare_db.sh

18 lines
800 B
Bash
Raw Normal View History

2011-10-20 22:44:37 +08:00
#!/bin/sh
# this script prepare database and redis instance to run accpetance test
# Note: requires a postgis template called template_postgis
2011-10-20 22:44:37 +08:00
echo "preparing redis..."
echo "HSET rails:users:vizzuality id 1" | redis-cli -n 5
2011-10-21 00:52:11 +08:00
echo "HSET rails:users:vizzuality database_name cartodb_test_user_1_db" | redis-cli -n 5
echo 'HSET rails:cartodb_test_user_1_db:my_table infowindow "this, that, the other"' | redis-cli -n 0
2011-10-20 22:44:37 +08:00
echo "preparing postgres..."
2011-10-21 00:52:11 +08:00
dropdb -Upostgres -hlocalhost cartodb_test_user_1_db
createdb -Upostgres -hlocalhost -Ttemplate_postgis -Opostgres -EUTF8 cartodb_test_user_1_db
psql -Upostgres -hlocalhost cartodb_test_user_1_db < ./sql/windshaft.test.sql
psql -Upostgres -hlocalhost cartodb_test_user_1_db < ./sql/gadm4.sql
2011-10-20 22:44:37 +08:00
echo "Finished preparing data. Run tests with expresso."