fix: resolve 10 bugs across scripts

- manage_runner.sh: fix RUNNER_DEFAULT_IMAGE clobbering by renaming
  per-runner var to RUNNER_SECTION_IMAGE; .env fallback now works
- manage_runner.sh: render native runner config.yaml before registration
  so act_runner can read it during --config flag
- manage_runner.sh: add SSH credential validation for remote hosts
  (fail early with clear error instead of cryptic SSH failure)
- phase1/phase2: add UNRAID_DB_IP/FEDORA_DB_IP to conditional
  require_vars when DB_TYPE != sqlite3
- cleanup.sh: only clear manifest when all actions for host succeeded;
  failed actions are preserved for retry
- phase8_cutover.sh: strip empty environment: block from Caddy
  docker-compose when TLS_MODE=existing
- phase5_migrate_pipelines.sh, phase5_teardown.sh, phase9_teardown.sh:
  wrap cd+git in subshells so working directory is always restored
- phase3_post_check.sh: handle both string and numeric runner status
  from Gitea API (offline vs 2)
- configure_env.sh: fix TOTAL_PROMPTS base count (63->64) and move
  DB/repo count adjustments before their prompts are shown

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
S
2026-03-01 13:21:30 -05:00
parent 045283be50
commit 9494645b3a
10 changed files with 94 additions and 60 deletions

View File

@@ -65,7 +65,7 @@ get_env_val() {
# Prompt function
# ---------------------------------------------------------------------------
# Base prompt count (fixed prompts + TLS conditional slots — repo/DB prompts added dynamically)
TOTAL_PROMPTS=63
TOTAL_PROMPTS=64
CURRENT_PROMPT=0
LAST_SECTION=""
@@ -267,6 +267,8 @@ prompt_var "GITEA_DB_TYPE" "Database type (sqlite3, mysql, postgres, ms
COLLECTED_DB_TYPE=$(get_env_val "GITEA_DB_TYPE" "sqlite3")
if [[ "$COLLECTED_DB_TYPE" != "sqlite3" ]]; then
# Update total BEFORE showing DB prompts so progress counter is accurate
TOTAL_PROMPTS=$((TOTAL_PROMPTS + 5))
# Determine default port based on DB type
case "$COLLECTED_DB_TYPE" in
mysql) db_port_default="3306" ;;
@@ -279,8 +281,6 @@ if [[ "$COLLECTED_DB_TYPE" != "sqlite3" ]]; then
prompt_var "GITEA_DB_NAME" "Database name" nonempty "gitea" "DATABASE"
prompt_var "GITEA_DB_USER" "Database user" nonempty "gitea" "DATABASE"
prompt_var "GITEA_DB_PASSWD" "Database password (min 8 chars)" password "" "DATABASE"
# Update total for the 5 DB prompts
TOTAL_PROMPTS=$((TOTAL_PROMPTS + 5))
fi
prompt_var "GITEA_VERSION" "Gitea Docker image tag" nonempty "1.25" "GITEA SHARED CREDENTIALS"
@@ -312,6 +312,8 @@ if [[ -n "$EXISTING_REPOS" ]]; then
EXISTING_COUNT=$#
fi
# Account for the "how many" prompt itself
TOTAL_PROMPTS=$((TOTAL_PROMPTS + 1))
CURRENT_PROMPT=$((CURRENT_PROMPT + 1))
printf '%b[%d/~%d]%b How many repos to migrate? %b[%s]%b: ' "$C_DIM" "$CURRENT_PROMPT" "$TOTAL_PROMPTS" "$C_RESET" "$C_YELLOW" "${EXISTING_COUNT:-3}" "$C_RESET"
read -r REPO_COUNT
@@ -321,8 +323,8 @@ while ! [[ "$REPO_COUNT" =~ ^[1-9][0-9]*$ ]]; do
printf 'How many repos to migrate? '
read -r REPO_COUNT
done
# Update total now that we know how many repos
TOTAL_PROMPTS=$((TOTAL_PROMPTS + 1 + REPO_COUNT))
# Now that we know repo count, add them to total
TOTAL_PROMPTS=$((TOTAL_PROMPTS + REPO_COUNT))
# Collect repo names
COLLECTED_REPOS=""