#!/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 ."
