prole/etc/init_database_options.sh
chrisfu 5e0a1bda85 feat: Add GitOps (Gitea) and Supabase integration, plus database options
- Makefile: Added 'init' and 'deploy' targets for k3s parity and Gitea staging.

- OpenTofu: Fixed namespace handling in k3s main.tf to prevent metadata overwrites.

- UI: Added 'GitOps' and 'Database Options' configuration screens.

- Core: Enhanced monitoring, milestones, and environment handling for new services.

- Supabase: Integrated full Helm chart and manifest rendering logic.

- Gitea: Added deployment scripts and GitOps sync support.

- Database: Added Percona/Postgres Dockerfile templates and improved TDE scripts.

- Tests: Added coverage for new UI screens and navigation flows.
2026-02-26 18:32:15 -08:00

44 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
set -e
# PROLE_HOME should be set by the caller
PROLE_CONF_DIR="${PROLE_HOME:-$HOME/.prole}/conf"
mkdir -p "$PROLE_CONF_DIR"
VERSION_FILE="$PROLE_CONF_DIR/database_versions.json"
echo "Fetching latest database versions..."
# Fetch latest PG version from Docker Hub (best effort)
get_latest_pg() {
curl -s https://registry.hub.docker.com/v2/repositories/library/postgres/tags?page_size=100 | \
grep -o '"name": *"[0-9][0-9]*"' | cut -d'"' -f4 | sort -ur | head -n 1 || echo "17"
}
PG_LATEST=$(get_latest_pg)
PG_CURRENT=$((PG_LATEST - 1))
PG_STABLE=$((PG_LATEST - 2))
# For Percona, let's use similar logic or defaults
PERCONA_LATEST="$PG_LATEST"
PERCONA_CURRENT="$PG_CURRENT"
PERCONA_STABLE="$PG_STABLE"
PERCONA_18="18"
cat <<EOF > "$VERSION_FILE"
{
"postgresql": {
"stable": "$PG_STABLE",
"current": "$PG_CURRENT",
"latest": "$PG_LATEST"
},
"percona": {
"stable": "$PERCONA_STABLE",
"current": "$PERCONA_CURRENT",
"latest": "$PERCONA_LATEST",
"v18": "$PERCONA_18"
}
}
EOF
echo "Database versions updated in $VERSION_FILE"