CartoDB-SQL-API/test/prepare_db.sh

18 lines
595 B
Bash
Raw Normal View History

2011-10-05 23:49:54 +08:00
#!/bin/sh
# this script prepare database and redis instance to run accpetance test
echo "preparing redis..."
echo "HSET rails:users:vizzuality id 1" | redis-cli -n 5
echo "HSET rails:users:vizzuality database_name cartodb_test_user_1_db" | redis-cli -n 5
2011-12-27 02:16:41 +08:00
echo "SADD rails:users:vizzuality:map_key 1234" | redis-cli -n 5
2011-10-05 23:49:54 +08:00
echo "preparing postgres..."
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 < test.sql
echo "ok, you can run test now"