-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·39 lines (31 loc) · 800 Bytes
/
build.sh
File metadata and controls
executable file
·39 lines (31 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
31
32
33
34
35
36
37
38
39
#!/bin/bash
# Build script for CodeSentry
# This script builds both frontend and backend together
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$SCRIPT_DIR"
echo "=== Building CodeSentry ==="
# Step 1: Build frontend
echo ""
echo ">>> Building frontend..."
cd frontend
npm ci
npm run build
cd ..
# Step 2: Copy frontend to backend static folder
echo ""
echo ">>> Copying frontend to backend/cmd/server/static/..."
rm -rf backend/cmd/server/static
cp -r frontend/dist backend/cmd/server/static
# Step 3: Build backend
echo ""
echo ">>> Building backend..."
cd backend
go build -o ../codesentry ./cmd/server/
cd ..
echo ""
echo "=== Build complete! ==="
echo ""
echo "Run with: ./codesentry"
echo "Default URL: http://localhost:8080"
echo "Default login: admin / admin"