-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
40 lines (35 loc) · 2.33 KB
/
Copy pathbuild.sh
File metadata and controls
40 lines (35 loc) · 2.33 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
#!/usr/bin/env bash
# ─────────────────────────────────────────────────────────────────
# Trinetra AI — Unified Build Script for Render
# Builds the React frontend and installs Python backend dependencies.
# ─────────────────────────────────────────────────────────────────
set -o errexit # Exit on any error
echo "══════════════════════════════════════════════════════════════"
echo " Trinetra AI — Build Script"
echo "══════════════════════════════════════════════════════════════"
# ─── 1. Build the React Frontend ─────────────────────────────────
echo ""
echo "▸ Step 1/3: Installing frontend dependencies..."
cd frontend
npm install
echo "▸ Step 2/3: Building React frontend..."
npm run build
cd ..
# ─── 2. Install Python Backend Dependencies ─────────────────────
echo ""
echo "▸ Step 3/3: Installing Python backend dependencies..."
pip install -r backend/requirements.txt
# ─── 3. Write Firebase credentials from env var (if available) ──
if [ -n "$FIREBASE_CREDENTIALS_JSON" ]; then
echo ""
echo "▸ Writing Firebase credentials from environment variable..."
echo "$FIREBASE_CREDENTIALS_JSON" > backend/serviceAccountKey.json
echo " ✅ serviceAccountKey.json written."
else
echo ""
echo " ⚠️ FIREBASE_CREDENTIALS_JSON not set — Firebase features may not work."
fi
echo ""
echo "══════════════════════════════════════════════════════════════"
echo " ✅ Build complete!"
echo "══════════════════════════════════════════════════════════════"