0
0
Fork 0
mirror of https://github.com/netdata/netdata.git synced 2025-05-08 11:00:27 +00:00
netdata_netdata/packaging/tools/agent-events/build.sh
Costa Tsaousis e032ee04e7
agent-events: add deduplicating web server (#20014)
add deduplicating web server
2025-03-31 18:04:03 +03:00

26 lines
586 B
Bash
Executable file

#!/bin/sh
# Exit immediately if a command exits with a non-zero status.
set -e
# Optional: Clean slate - remove existing module files
test -f "go.mod" && rm -f go.mod
test -f "go.sum" && rm -f go.sum
# 1. Initialize the Go module
echo "Initializing Go module..."
go mod init server
# 2. Tidy dependencies
echo "Tidying dependencies..."
go mod tidy
# 3. Build the main server executable using '.' for current package
echo "Building server executable..."
go build -o ./server .
# 4. Run the unit tests
echo "Running unit tests..."
go test -v
echo "Build and test script finished."