feat: initial Go project scaffold with build/test/release pipeline

- Go module: github.com/netcell-it/deklarix
- cmd/server/main.go: HTTP entry point with /health endpoint
- scripts/build.sh: cross-compile amd64 + arm64
- scripts/test.sh: go vet + race tests + build-check
- scripts/release.sh: full release flow (test → build → tag → push)
- packaging/DEBIAN: .deb control template
- design/enterprise.css: enterprise design system from enconf
- CLAUDE.md: complete build/test/release documentation
- .claude/settings.local.json: Claude Code permissions
This commit is contained in:
2026-08-26 22:16:44 +02:00
parent a04e805fe1
commit 11cf9083fa
10 changed files with 4807 additions and 0 deletions

52
scripts/build.sh Executable file
View File

@@ -0,0 +1,52 @@
#!/usr/bin/env bash
# Deklarix — Build-Skript (amd64 + arm64)
#
# Verwendung:
# ./scripts/build.sh [version] # Beide Architekturen
# ./scripts/build.sh [version] amd64 # Nur amd64
# ./scripts/build.sh [version] arm64 # Nur arm64
#
# Ausgabe: dist/deklarix_<version>_<arch>
#
# Release-Prozess:
# 1. VERSION erhöhen (Semantic Versioning: MAJOR.MINOR.PATCH)
# 2. ./scripts/build.sh <version>
# 3. ./scripts/test.sh
# 4. git tag v<version> && git push origin v<version>
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
REPO_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
VERSION="${1:-0.0.1}"
ARCH_FILTER="${2:-both}"
GRN='\033[0;32m'; BLD='\033[1m'; NC='\033[0m'
log() { echo -e "${GRN}[build]${NC} $*"; }
export PATH=$PATH:/usr/local/go/bin
command -v go >/dev/null || { echo "Go nicht gefunden — PATH: $PATH"; exit 1; }
mkdir -p "$REPO_DIR/dist"
log "Version: $VERSION | Go: $(go version)"
ARCHS=()
case "$ARCH_FILTER" in
amd64) ARCHS=("amd64") ;;
arm64) ARCHS=("arm64") ;;
*) ARCHS=("amd64" "arm64") ;;
esac
for ARCH in "${ARCHS[@]}"; do
OUT="$REPO_DIR/dist/deklarix_${VERSION}_${ARCH}"
log "Baue $ARCH$OUT"
GOARCH=$ARCH GOOS=linux go build \
-ldflags="-X main.Version=${VERSION} -s -w" \
-o "$OUT" \
./cmd/server/
log "$ARCH fertig: $(du -sh "$OUT" | cut -f1)"
done
log "Build abgeschlossen ✓"

60
scripts/release.sh Executable file
View File

@@ -0,0 +1,60 @@
#!/usr/bin/env bash
# Deklarix — Release-Skript
#
# Verwendung: ./scripts/release.sh <version>
# Beispiel: ./scripts/release.sh 1.2.0
#
# Was passiert:
# 1. Tests laufen
# 2. Build für amd64 + arm64
# 3. git tag v<version> wird gesetzt
# 4. git push origin main + git push origin v<version>
#
# Voraussetzungen:
# - Sauberer Git-Status (keine uncommitted changes)
# - Alle Tests grün
set -euo pipefail
REPO_DIR="$(cd "$(dirname "$0")/.." && pwd)"
VERSION="${1:-}"
if [[ -z "$VERSION" ]]; then
echo "Verwendung: $0 <version> (z.B. 1.0.0)"
exit 1
fi
GRN='\033[0;32m'; BLD='\033[1m'; NC='\033[0m'
log() { echo -e "${GRN}[release]${NC} $*"; }
cd "$REPO_DIR"
# Git-Status prüfen
if [[ -n "$(git status --porcelain)" ]]; then
echo "FEHLER: Uncommitted changes vorhanden — bitte erst committen"
git status --short
exit 1
fi
log "Release v${VERSION} wird vorbereitet..."
# Tests
log "Tests laufen..."
bash "$REPO_DIR/scripts/test.sh"
# Build
log "Build für alle Architekturen..."
bash "$REPO_DIR/scripts/build.sh" "$VERSION"
# Git Tag
log "Tag v${VERSION} setzen..."
git tag -a "v${VERSION}" -m "Release v${VERSION}"
# Push
log "Push main + Tag..."
git push origin main
git push origin "v${VERSION}"
log ""
log "Release v${VERSION} fertig ✓"
log "Binaries: dist/deklarix_${VERSION}_amd64 + _arm64"

27
scripts/test.sh Executable file
View File

@@ -0,0 +1,27 @@
#!/usr/bin/env bash
# Deklarix — Test-Skript
#
# Führt alle Go-Tests aus + Vet + Build-Check.
# Wird auch im CI/vor jedem Release ausgeführt.
set -euo pipefail
REPO_DIR="$(cd "$(dirname "$0")/.." && pwd)"
export PATH=$PATH:/usr/local/go/bin
GRN='\033[0;32m'; RED='\033[0;31m'; NC='\033[0m'
log() { echo -e "${GRN}[test]${NC} $*"; }
fail() { echo -e "${RED}[FAIL]${NC} $*"; exit 1; }
cd "$REPO_DIR"
log "go vet ..."
go vet ./... || fail "go vet fehlgeschlagen"
log "go test ./... "
go test -race -count=1 ./... || fail "Tests fehlgeschlagen"
log "Build-Check (amd64) ..."
GOARCH=amd64 GOOS=linux go build -o /dev/null ./cmd/server/ || fail "Build fehlgeschlagen"
log "Alle Tests bestanden ✓"