nitrokite/backend/build.sh
Farid Siddiqi a1360919f0
Some checks failed
Build and Deploy API Server & Frontend / deploy (push) Blocked by required conditions
Build and Deploy API Server & Frontend / build-backend (push) Has been cancelled
Build and Deploy API Server & Frontend / build-frontend (push) Has been cancelled
Add frontend React dashboard with CI/CD deployment pipeline
2025-12-25 22:08:03 -08:00

24 lines
594 B
Bash
Executable File

#!/bin/bash
set -e
echo "🔨 Building Nitrokite API Server..."
# Navigate to backend directory
cd "$(dirname "$0")"
# Get build information
COMMIT_SHA=$(git rev-parse --short HEAD 2>/dev/null || echo "dev")
BUILD_TIME=$(date -u +%Y-%m-%dT%H:%M:%SZ)
# Build the binary
echo "📦 Building binary for Linux..."
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build \
-ldflags="-s -w -X main.Version=${COMMIT_SHA} -X main.BuildTime=${BUILD_TIME}" \
-o api-server \
.
echo "✅ Build complete!"
echo " Binary: api-server"
echo " Version: ${COMMIT_SHA}"
echo " Build Time: ${BUILD_TIME}"