-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
Β·60 lines (48 loc) Β· 1.34 KB
/
build.sh
File metadata and controls
executable file
Β·60 lines (48 loc) Β· 1.34 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/bash
set -e # Exit on any error
echo "π¨ Building RollingStone..."
echo ""
# Check for required dependencies
echo "π Checking dependencies..."
# Check for Node.js
if ! command -v node &> /dev/null; then
echo "β Node.js is not installed"
echo " Install with: brew install node"
exit 1
fi
# Check for npm
if ! command -v npm &> /dev/null; then
echo "β npm is not installed"
echo " Install with: brew install node"
exit 1
fi
# Check for Go
if ! command -v go &> /dev/null; then
echo "β Go is not installed"
echo " Install with: brew install go"
exit 1
fi
# Check Go version
GO_VERSION=$(go version | awk '{print $3}' | sed 's/go//')
REQUIRED_GO_VERSION="1.21.0"
if [ "$(printf '%s\n' "$REQUIRED_GO_VERSION" "$GO_VERSION" | sort -V | head -n1)" != "$REQUIRED_GO_VERSION" ]; then
echo "β οΈ Warning: Go version $GO_VERSION found, but $REQUIRED_GO_VERSION or higher is required"
fi
echo "β
All dependencies found"
echo ""
# Install and build frontend
echo "π¦ Installing frontend dependencies..."
cd web
npm install
echo ""
echo "π¦ Building frontend..."
npm run build
cd ..
echo "β
Frontend built"
echo ""
# Build backend
echo "π§ Building backend (Go)..."
go build -o rollingstone ./cmd/server
echo "β
Backend built"
echo ""
echo "π Build complete! Run ./start.sh to start the server"