website-and-documentation/scripts/get-versions.sh
Stephan Lo 4294524e81 feat(ci): add Docker build pipeline with version management
- Add multi-stage Dockerfile with pinned tool versions (Node 24.10.0, Go 1.25.1, Hugo 0.151.0)
- Create .env.versions as single source of truth for all tool versions
- Add GitHub Actions CI workflow for automated OCI image builds
  - Multi-arch support (amd64, arm64)
  - Automatic version loading from .env.versions
  - Docker registry push with metadata tags
- Add Taskfile tasks for local OCI image building and testing
  - task build:oci-image - Build with version-pinned dependencies
  - task test:oci-image - Build and test container locally
- Pin devbox.json to specific versions matching .env.versions
- Add comprehensive documentation (DOCKER.md, VERSIONS.md)
- Add helper script (scripts/get-versions.sh) for version extraction

This enables consistent development and production environments with
identical tool versions across local devbox, Docker builds, and CI/CD.
2025-10-23 17:04:28 +02:00

28 lines
822 B
Bash
Executable file

#!/bin/bash
# Load versions from .env.versions for Docker build
# Usage: source scripts/get-versions.sh
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
VERSIONS_FILE="${SCRIPT_DIR}/../.env.versions"
if [ ! -f "$VERSIONS_FILE" ]; then
echo "Error: .env.versions not found at $VERSIONS_FILE"
exit 1
fi
# Load versions
set -a
source "$VERSIONS_FILE"
set +a
echo "Loaded versions from .env.versions:"
echo " NODE_VERSION=${NODE_VERSION}"
echo " GO_VERSION=${GO_VERSION}"
echo " HUGO_VERSION=${HUGO_VERSION}"
echo ""
echo "Build Docker image with:"
echo " docker build --network=host \\"
echo " --build-arg NODE_VERSION=${NODE_VERSION} \\"
echo " --build-arg GO_VERSION=${GO_VERSION} \\"
echo " --build-arg HUGO_VERSION=${HUGO_VERSION} \\"
echo " -t ipceicis-developerframework:latest ."