57 lines
2.3 KiB
Bash
Executable File
57 lines
2.3 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# ==============================================================================
|
|
# Auth-Yes Full Infrastructure Build & Release Pipeline
|
|
# ==============================================================================
|
|
set -e
|
|
|
|
# Change to repository root
|
|
REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
cd "$REPO_ROOT"
|
|
|
|
echo "================================================================"
|
|
echo " Auth-Yes Build & Release Pipeline"
|
|
echo "================================================================"
|
|
|
|
# 1. Run Pre-flight Quality Gates
|
|
echo -e "\n[1/5] Running Quality Gates..."
|
|
deno fmt --check
|
|
deno task lint
|
|
deno task check
|
|
deno task test
|
|
|
|
# 2. Compile Protobufs & Workload APIs
|
|
echo -e "\n[2/5] Compiling Protobufs..."
|
|
deno run -A infra/setup.ts compile_proto
|
|
|
|
# 3. Generate Infrastructure Artifacts (Non-Interactive / Headless)
|
|
echo -e "\n[3/5] Generating Infrastructure Configuration Artifacts..."
|
|
deno run -A infra/setup.ts auth --auto \
|
|
--registry "${REG:-quay.atyg.org}" \
|
|
--ghcr-registry "${GHCR_REG:-ghcr.atyg.org}" \
|
|
--domain "${SYSTEM_DOMAIN:-auth.atyg.org}" \
|
|
--db-path "${DB_DATA_PATH:-/volume1/docker/auth-yes/data}" \
|
|
--spire-path "${SPIRE_DATA_PATH:-/volume1/docker/spire}"
|
|
|
|
# 4. Build & Push All Container Images to Registry
|
|
echo -e "\n[4/5] Building and Pushing Container Images..."
|
|
deno run -A infra/setup.ts build
|
|
|
|
# 5. Output Summary, Persistence Topology, and Compose Stacks
|
|
echo -e "\n[5/5] Release Summary & Stack Specifications..."
|
|
deno run -A infra/setup.ts secrets
|
|
|
|
echo -e "\n----------------------------------------------------------------"
|
|
echo " GENERATED DOCKER / PODMAN COMPOSE SPECIFICATIONS"
|
|
echo "----------------------------------------------------------------"
|
|
deno run -A infra/setup.ts dump_compose
|
|
|
|
echo -e "\n================================================================"
|
|
echo " DEPLOYMENT COMMANDS"
|
|
echo "================================================================"
|
|
echo "1. Deploy SPIRE Authority Stack:"
|
|
echo " podman-compose --project-name spire --env-file infra/.env -f infra/compose.spire.yml up -d"
|
|
echo ""
|
|
echo "2. Deploy Auth-Yes IAM Stack:"
|
|
echo " podman-compose --project-name auth-yes --env-file infra/.env -f infra/compose.yml up -d"
|
|
echo "================================================================"
|