-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.sh
executable file
·39 lines (30 loc) · 1.09 KB
/
run.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
# Load environment variables from .env file
set -a
source .env
set +a
# Remove all services including volumes
echo "Removing all services including volumes..."
docker-compose down -v
# Clear the terminal
clear
echo "Building all services..."
docker-compose build
# Clear the terminal
clear
# Start all services in detached mode
echo "Starting all services..."
docker-compose up -d
# Clear the terminal
clear
# Check if the Cassandra plugin is installed by checking the directory
plugin_installed=$(docker-compose exec -T grafana /bin/bash -c '[ -d "/var/lib/grafana/plugins/$GRAFANA_DATASOURCE_TYPE" ] && echo "installed" || echo "not installed"')
msg="Cassandra plugin not installed. Waiting"
echo -n "$msg"
while [ "$plugin_installed" != "installed" ]; do
echo -n "."
sleep 5
plugin_installed=$(docker-compose exec -T grafana /bin/bash -c '[ -d "/var/lib/grafana/plugins/$GRAFANA_DATASOURCE_TYPE" ] && echo "installed" || echo "not installed"')
done
# Plugin installed, restart Grafana container
echo "Cassandra plugin installed. Restarting Grafana container..."
docker-compose restart grafana