Files
dance-lessons-coach/scripts/build-with-version.sh
Gabriel Radureau c1e628f339 📝 docs: update comprehensive documentation and project infrastructure
Documentation Updates:
- Enhanced AGENTS.md with user authentication details
- Updated README.md with authentication API documentation
- Added CONTRIBUTING.md guidelines for BDD testing
- Version management guide improvements
- Local CI/CD testing documentation

Project Infrastructure:
- Updated .gitignore for new file patterns
- Enhanced git hooks documentation
- YAML linting configuration
- Script improvements and organization
- Configuration management updates

API Enhancements:
- Greet service integration with authentication
- Server middleware for JWT validation
- Telemetry improvements
- Version management utilities

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-04-09 00:26:15 +02:00

43 lines
1.2 KiB
Bash
Executable File

#!/bin/bash
# Build dance-lessons-coach with version information
# Usage: ./scripts/build-with-version.sh [output_path]
set -e
# Default output path
OUTPUT_PATH="${1:-bin/server}"
# Get version from VERSION file or use default
if [ -f "VERSION" ]; then
source VERSION
VERSION="$MAJOR.$MINOR.$PATCH${PRERELEASE:+-$PRERELEASE}"
else
VERSION="1.0.0"
fi
# Get git information
GIT_COMMIT=$(git rev-parse --short HEAD 2>/dev/null || echo "unknown")
GIT_DATE=$(git log -1 --format=%cd --date=short 2>/dev/null || echo "unknown")
# Build time (UTC for consistency)
BUILD_DATE=$(date -u +%Y-%m-%dT%H:%M:%SZ)
echo "🔧 Building dance-lessons-coach $VERSION"
echo " Commit: $GIT_COMMIT"
echo " Date: $GIT_DATE"
echo " Output: $OUTPUT_PATH"
# Build with ldflags to inject version information
go build \
-o "$OUTPUT_PATH" \
-ldflags="\
-X dance-lessons-coach/pkg/version.Version=$VERSION \
-X dance-lessons-coach/pkg/version.Commit=$GIT_COMMIT \
-X dance-lessons-coach/pkg/version.Date=$BUILD_DATE \
" \
./cmd/server
echo "✅ Build complete: $OUTPUT_PATH"
# Show version info
"$OUTPUT_PATH" --version 2>/dev/null || echo "Version: $VERSION"