-
Notifications
You must be signed in to change notification settings - Fork 3
/
justfile
64 lines (46 loc) · 1.58 KB
/
justfile
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
DOCKER_COMPOSE_FILE := "ci/docker-compose.yml"
install:
#!/usr/bin/env bash
set -euo pipefail
cargo install --path .
celestia-up:
#!/usr/bin/env bash
set -euo pipefail
echo "Cleaning up any existing Docker resources..."
docker-compose -f {{DOCKER_COMPOSE_FILE}} down -v --remove-orphans
echo "Spinning up a fresh Docker Compose stack..."
docker-compose -f {{DOCKER_COMPOSE_FILE}} up -d --force-recreate --renew-anon-volumes
echo "Waiting for services to be ready..."
timeout=120
start_time=$(date +%s)
light_node_ready=false
bridge_node_ready=false
while true; do
logs=$(docker-compose -f {{DOCKER_COMPOSE_FILE}} logs)
if [[ $logs == *"Configuration finished. Running a light node"* ]]; then
light_node_ready=true
echo "Light node is ready!"
fi
if [[ $logs == *"Configuration finished. Running a bridge node"* ]]; then
bridge_node_ready=true
echo "Bridge node is ready!"
fi
if $light_node_ready && $bridge_node_ready; then
echo "All services are ready!"
break
fi
current_time=$(date +%s)
elapsed=$((current_time - start_time))
if [ $elapsed -ge $timeout ]; then
echo "Timeout waiting for services to be ready. Check the logs for more information."
docker-compose -f {{DOCKER_COMPOSE_FILE}} logs
exit 1
fi
echo "Still waiting... (${elapsed}s elapsed)"
sleep 5
done
echo "Celestia stack is up and running!"
celestia-down:
docker-compose -f {{DOCKER_COMPOSE_FILE}} down -v --remove-orphans
celestia-logs:
docker-compose -f {{DOCKER_COMPOSE_FILE}} logs -f