-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcleanup.sh
35 lines (32 loc) · 1.22 KB
/
cleanup.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
#!/bin/bash
# Read configuration from config.yaml
CREATE_DB=$(yq '.create_db' config.yaml)
RETAIN_DB=$(yq '.retain_db' config.yaml)
# Stop and remove containers started by docker-compose
echo "Stopping docker-compose services..."
cd ingest/docker
if [ "$CREATE_DB" == "false" ]; then
docker compose down
echo "Docker compose services stopped successfully."
elif [ "$CREATE_DB" == "true" ]; then
if [ "$RETAIN_DB" == "true" ]; then
docker stop dotlake_sidecar_instance subindex-ingest superset
docker rm dotlake_sidecar_instance subindex-ingest superset
echo "Docker services stopped successfully (keeping postgres running)."
else
docker stop dotlake_sidecar_instance subindex-ingest superset postgres_db
docker rm dotlake_sidecar_instance subindex-ingest superset postgres_db
echo "All docker services including database stopped and removed."
fi
else
echo "No docker compose files found in ingest/docker directory."
fi
cd ../../
# Remove the docker network if it exists
if docker network ls | grep -q "dotlake_network"; then
docker network rm dotlake_network
echo "Removed dotlake_network."
else
echo "dotlake_network not found."
fi
echo "Cleanup complete."