forked from amancevice/docker-superset
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdemo.sh
executable file
·48 lines (41 loc) · 1.1 KB
/
demo.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash
set -e
if [ -z $1 ]; then
echo "Usage: bash demo.sh mysql|postgres|sqlite|celery"
exit 1
elif [ "$1" != "mysql" ] && [ "$1" != "postgres" ] && [ "$1" != "sqlite" ] && [ "$1" != "celery" ]; then
echo "Usage: bash demo.sh mysql|postgres|sqlite|celery"
exit 1
fi
cd $1
# Start back end
if [ "$1" == "sqlite" ]; then
echo "Starting redis service..."
docker-compose up -d redis
>| ./superset/superset.db
elif [ "$1" == "mysql" ] || [ "$1" == "postgres" ]; then
echo "Starting redis & $1 services..."
docker-compose up -d redis $1
echo "Sleeping for 30s"
sleep 30
else
echo "Starting redis & postgres services..."
docker-compose up -d redis postgres
echo "Sleeping for 30s"
sleep 30
fi
# Start Superset
echo "Starting Superset..."
docker-compose up -d superset
if [ "$1" == "celery" ]; then
echo "Starting Superset worker..."
docker-compose up -d worker
fi
echo "Sleeping for 30s"
sleep 30
# Inititalize Demo
docker-compose exec superset superset-demo
echo "Navigate to http://localhost:8088 to view demo"
echo -n "Press RETURN to bring down demo"
read down
docker-compose down -v