-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDeploy.sh
More file actions
37 lines (30 loc) · 999 Bytes
/
Deploy.sh
File metadata and controls
37 lines (30 loc) · 999 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
31
32
33
34
35
36
37
#!/bin/bash
set -e
APP_NAME="enclov-AI"
REPO_URL="https://github.com/Web4application/enclov-AI.git"
FRONTEND_PATH="./index.html"
BACKEND_PATH="./app"
VERCEL_PROJECT_NAME="enclov-ai-frontend"
echo "🚀 Deploying $APP_NAME..."
# Step 1: Pull latest
if [ ! -d "$APP_NAME" ]; then
git clone $https://github.com/Web4application/enclov-AI.git
else
echo "🔄 Repo already exists. Pulling latest..."
cd $APP_NAME && git pull && cd ..
fi
cd $enclove-AI
# Step 2: Check Docker Compose
echo "🐳 Starting Docker Compose stack..."
docker-compose up -d --build
# Step 3: Vercel Frontend Deploy (if installed)
if command -v vercel &> /dev/null; then
echo "🌐 Deploying static frontend to Vercel..."
cd frontend || mkdir frontend && cp $FRONTEND_PATH frontend/index.html && cd frontend
vercel --prod --confirm --name "$VERCEL_PROJECT_NAME"
cd ..
else
echo "⚠️ Vercel CLI not found. Skipping frontend deploy."
echo "Install via: npm i -g vercel"
fi
echo "✅ Deployment complete."