-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathdev-reload.sh
executable file
·38 lines (29 loc) · 1.06 KB
/
dev-reload.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
#!/bin/bash
set -e
# Print what we're doing
echo "Rebuilding Rust binaries and restarting containers..."
# Define color codes for output
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m' # No Color
# 1. Compile the binaries locally
echo -e "${BLUE}Compiling Rust code...${NC}"
cargo build --release
# 2. Check if compilation succeeded
if [ $? -ne 0 ]; then
echo -e "${YELLOW}Compilation failed. Not restarting containers.${NC}"
exit 1
fi
echo -e "${GREEN}Compilation successful!${NC}"
# 3. Restart the containers with the newly compiled binaries
echo -e "${BLUE}Restarting containers...${NC}"
cd contrib
docker compose -f docker-compose.dev.yml restart indexer-service tap-agent
# 4. Verify the containers are running
echo -e "${BLUE}Checking container status...${NC}"
docker compose -f docker-compose.dev.yml ps
echo -e "${GREEN}Done! Containers restarted with new binaries.${NC}"
# Optional: Check logs for immediate errors
echo -e "${BLUE}Showing recent logs (Ctrl+C to exit):${NC}"
docker compose -f docker-compose.dev.yml logs --tail=20 -f