feat: add distribution and fleet management — CI/CD, OCI, metrics, ARM64 (Phase 5)
- Gitea Actions CI pipeline: Go tests, build, shellcheck on push/PR - Gitea Actions release pipeline: full build + artifact upload on version tags - OCI container image builder for registry-based OS distribution - Zero-dependency Prometheus metrics endpoint (kubesolo_os_info, boot, memory, update status) with 10 tests - USB provisioning tool for air-gapped deployments with cloud-init injection - ARM64 cross-compilation support (TARGET_ARCH env var + build-cross.sh) - Updated build scripts to accept TARGET_ARCH for both amd64 and arm64 - New Makefile targets: oci-image, build-cross Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -3,15 +3,19 @@
|
||||
#
|
||||
# Builds a static Linux binary for the update agent.
|
||||
# Output: build/cache/kubesolo-update
|
||||
#
|
||||
# Environment:
|
||||
# TARGET_ARCH Target architecture (default: amd64, also supports: arm64)
|
||||
set -euo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
|
||||
UPDATE_DIR="$PROJECT_ROOT/update"
|
||||
CACHE_DIR="$PROJECT_ROOT/build/cache"
|
||||
TARGET_ARCH="${TARGET_ARCH:-amd64}"
|
||||
OUTPUT="$CACHE_DIR/kubesolo-update"
|
||||
|
||||
echo "=== Building KubeSolo Update Agent ==="
|
||||
echo "=== Building KubeSolo Update Agent (linux/$TARGET_ARCH) ==="
|
||||
|
||||
# Ensure output dir exists
|
||||
mkdir -p "$CACHE_DIR"
|
||||
@@ -22,7 +26,7 @@ echo "--- Running tests ---"
|
||||
|
||||
# Build static binary
|
||||
echo "--- Compiling static binary ---"
|
||||
(cd "$UPDATE_DIR" && CGO_ENABLED=0 GOOS=linux GOARCH=amd64 \
|
||||
(cd "$UPDATE_DIR" && CGO_ENABLED=0 GOOS=linux GOARCH="$TARGET_ARCH" \
|
||||
go build -ldflags='-s -w' -o "$OUTPUT" .)
|
||||
|
||||
SIZE=$(ls -lh "$OUTPUT" | awk '{print $5}')
|
||||
|
||||
Reference in New Issue
Block a user