Files
docker/scripts/docs/render-compose-config.sh
T

26 lines
774 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
ROOT="$(git rev-parse --show-toplevel 2>/dev/null || pwd)"
cd "$ROOT"
mkdir -p docs/generated
mapfile -t COMPOSE_FILES < <(scripts/docs/list-compose-files.sh)
if [ "${#COMPOSE_FILES[@]}" -eq 0 ]; then
echo "No compose files found" >&2
exit 1
fi
printf '%s\n' "${COMPOSE_FILES[@]}" > docs/generated/compose-files.txt
ARGS=()
for file in "${COMPOSE_FILES[@]}"; do ARGS+=("-f" "$file"); done
ENV_FILE=""
if [ -f default-environment.env ]; then
ENV_FILE="default-environment.env"
else
ENV_FILE="scripts/docs/ci-default.env"
fi
if [ ! -f "$ENV_FILE" ]; then
echo "Environment file not found: $ENV_FILE" >&2
exit 1
fi
docker compose -p core --env-file "$ENV_FILE" "${ARGS[@]}" config > docs/generated/docker-compose.resolved.yml