-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·79 lines (68 loc) · 2.05 KB
/
build.sh
File metadata and controls
executable file
·79 lines (68 loc) · 2.05 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/bin/bash
# Build script for distributed-regional-check-agent .deb package
set -e
echo "Building CheckCle Distributed Regional Check Agent .deb package..."
# Check if required tools are installed
command -v dpkg-deb >/dev/null 2>&1 || {
echo "Error: dpkg-deb is required but not installed."
echo "Install with: sudo apt-get install dpkg-dev"
exit 1
}
command -v go >/dev/null 2>&1 || {
echo "Error: Go is required but not installed."
exit 1
}
# Show current directory for context
echo "Building from: $(pwd)"
# Clean previous builds
echo "Cleaning previous builds..."
make clean
# Check for architecture argument
ARCH=${1:-"all"}
case $ARCH in
amd64)
echo "Building for AMD64 architecture..."
make deb-amd64
;;
arm64)
echo "Building for ARM64 architecture..."
make deb-arm64
;;
all)
echo "Building for both AMD64 and ARM64 architectures..."
make deb-all
;;
*)
echo "Usage: $0 [amd64|arm64|all]"
echo " amd64 - Build only for AMD64"
echo " arm64 - Build only for ARM64"
echo " all - Build for both architectures (default)"
exit 1
;;
esac
echo ""
echo "✅ Build complete!"
echo ""
echo "📦 Generated packages:"
ls -la build/*.deb 2>/dev/null || echo "No packages found"
echo ""
echo "🚀 To install a package:"
echo " sudo dpkg -i build/distributed-regional-check-agent_1.0.0_amd64.deb"
echo " # or"
echo " sudo dpkg -i build/distributed-regional-check-agent_1.0.0_arm64.deb"
echo ""
echo "📋 To install dependencies if needed:"
echo " sudo apt-get install -f"
echo ""
echo "⚙️ To configure (REQUIRED before starting):"
echo " sudo nano /etc/regional-check-agent/regional-check-agent.env"
echo ""
echo "🔧 To start after configuration:"
echo " sudo systemctl enable regional-check-agent"
echo " sudo systemctl start regional-check-agent"
echo ""
echo "📊 To check status:"
echo " sudo systemctl status regional-check-agent"
echo ""
echo "🩺 Health check endpoint:"
echo " curl http://localhost:8091/health"