Validate login GitOps repo / validate (push) Successful in 9s
- Keycloak Operator v26 deployed to keycloak-system namespace - Keycloak HA instance (2 replicas, jdbc-ping cluster discovery) - Dedicated CNPG cluster (local-postgres storage, 2 instances) - KeycloakRealmImport: home-lab realm with groups and traefik-oidc client - Traefik IngressRoute: login.olb42.com (CF Access bypass) - Admin credentials placeholder (seal before first deploy) - ArgoCD ApplicationSets: login-operator + login
36 lines
1.0 KiB
Bash
Executable File
36 lines
1.0 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Copied from helm-template; update GITEA_API_URL and repo details as needed.
|
|
set -euo pipefail
|
|
|
|
GITEA_API_URL="${GITEA_API_URL:-https://git.olb42.com/api/v1}"
|
|
REPO_OWNER="${REPO_OWNER:-olb42}"
|
|
REPO_NAME="${REPO_NAME:-login}"
|
|
PR_BRANCH="dormant/$(date +%Y%m%d-%H%M%S)"
|
|
BASE_BRANCH="main"
|
|
|
|
if [[ -z "${GITEA_TOKEN:-}" ]]; then
|
|
echo "GITEA_TOKEN is required"
|
|
exit 1
|
|
fi
|
|
|
|
git config user.email "[email protected]"
|
|
git config user.name "CI Automation"
|
|
|
|
git checkout -b "$PR_BRANCH"
|
|
|
|
# Swap production overlay for dormant in the ArgoCD ApplicationSet
|
|
# This is handled by ArgoCD dormant logic; just open the PR.
|
|
git push origin "$PR_BRANCH"
|
|
|
|
curl -s -X POST "$GITEA_API_URL/repos/$REPO_OWNER/$REPO_NAME/pulls" \
|
|
-H "Authorization: token $GITEA_TOKEN" \
|
|
-H "Content-Type: application/json" \
|
|
-d "{
|
|
\"title\": \"Propose dormant mode for login\",
|
|
\"body\": \"Automated PR to switch login Keycloak to dormant overlay.\",
|
|
\"head\": \"$PR_BRANCH\",
|
|
\"base\": \"$BASE_BRANCH\"
|
|
}"
|
|
|
|
echo "Dormant PR created"
|