-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathauto-update-aztec.sh
More file actions
40 lines (31 loc) · 1 KB
/
auto-update-aztec.sh
File metadata and controls
40 lines (31 loc) · 1 KB
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
#!/bin/bash
set -e
# Config
IMAGE_TAG="aztecprotocol/aztec:alpha-testnet"
COMPOSE_FILE="docker-compose.yml"
# Check if compose file exists
if [ ! -f "$COMPOSE_FILE" ]; then
echo "❌ $COMPOSE_FILE not found in current directory. Please run this script in the folder containing your docker-compose.yml."
exit 1
fi
# Backup
echo "📁 Backing up $COMPOSE_FILE to ${COMPOSE_FILE}.bak..."
cp "$COMPOSE_FILE" "${COMPOSE_FILE}.bak"
# Update image version
echo "🔍 Updating image version in $COMPOSE_FILE..."
sed -i "s|image: aztecprotocol/aztec:.*|image: ${IMAGE_TAG}|" "$COMPOSE_FILE"
# Stop container
echo "🛑 Stopping container..."
docker compose down || true
# Delete old data
echo "🧹 Removing old database..."
rm -rf ./data || true
# Pull image
echo "⬇️ Pulling image $IMAGE_TAG..."
docker pull "$IMAGE_TAG"
# Start container
echo "🚀 Starting upgraded node..."
docker compose --env-file .env up -d
# Show logs
echo "📄 Upgrade complete. Showing logs..."
docker logs -f --tail=100 aztec-sequencer