forked from Kpa-clawbot/CoreScope
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy-staging.sh
More file actions
30 lines (22 loc) · 800 Bytes
/
Copy pathdeploy-staging.sh
File metadata and controls
30 lines (22 loc) · 800 Bytes
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
#!/bin/bash
set -e
DEPLOY_DIR="$(cd "$(dirname "$0")" && pwd)"
cd "$DEPLOY_DIR"
echo "[staging] Fetching latest from origin..."
git fetch origin
BRANCH="${1:-master}"
echo "[staging] Checking out $BRANCH..."
git reset --hard "origin/$BRANCH"
echo "[staging] Building Docker image..."
docker build -t meshcore-analyzer-staging .
echo "[staging] Stopping old container (30s grace period)..."
docker stop -t 30 meshcore-staging 2>/dev/null || true
docker rm meshcore-staging 2>/dev/null || true
echo "[staging] Starting new container..."
docker run -d --name meshcore-staging \
--restart unless-stopped \
-p 3001:3000 \
-v "$(pwd)/config.json:/app/config.json:ro" \
-v meshcore-staging-data:/app/data \
meshcore-analyzer-staging
echo "[staging] Done. Live at https://staging.on8ar.eu"