mirror of
git://f0xx.org/ac/ac-deploy
synced 2026-07-29 05:38:25 +03:00
Compose lab PHP from ac-workspace overlay; 301 /crashes/ → /issues/; verify on issues path; optional native Postgres on cast01. Co-authored-by: Cursor <cursoragent@cursor.com>
59 lines
1.6 KiB
Bash
Executable File
59 lines
1.6 KiB
Bash
Executable File
#!/bin/sh
|
|
# Validate ac-workspace + legacy runtime on this cluster node.
|
|
set -eu
|
|
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
|
# shellcheck source=/dev/null
|
|
. "$ROOT/scripts/lib/common.sh"
|
|
load_cluster_env
|
|
|
|
FAIL=0
|
|
check_dir() {
|
|
_label="$1"
|
|
_path="$2"
|
|
if [ -d "$_path" ]; then
|
|
log "OK ${_label} ${_path}"
|
|
else
|
|
log "FAIL missing ${_label} ${_path}"
|
|
FAIL=1
|
|
fi
|
|
}
|
|
|
|
check_file() {
|
|
_label="$1"
|
|
_path="$2"
|
|
if [ -f "$_path" ]; then
|
|
log "OK ${_label}"
|
|
else
|
|
log "FAIL missing ${_label} ${_path}"
|
|
FAIL=1
|
|
fi
|
|
}
|
|
|
|
AC_ROOT="${AC_WORKSPACE_ROOT:-/var/www/ac/workspace}"
|
|
LEGACY="${APP_ROOT}/android_cast"
|
|
|
|
log "validate-ac-repos on $(host_short)"
|
|
check_dir "ac-workspace" "$AC_ROOT"
|
|
check_dir "ac-platform-db" "${AC_ROOT}/ac-platform-db/sql/crash_reporter"
|
|
check_dir "ac-platform-php" "${AC_ROOT}/ac-platform-php/src"
|
|
check_dir "ac-platform-web" "${AC_ROOT}/ac-platform-web/assets/css"
|
|
check_dir "composed-backend" "${COMPOSE_BACKEND:-/var/www/ac/composed/backend}"
|
|
check_file "composed-index" "${COMPOSE_BACKEND:-/var/www/ac/composed/backend}/public/index.php"
|
|
check_file "legacy-backend" "${LEGACY}/examples/crash_reporter/backend/public/index.php"
|
|
check_dir "legacy-monolith" "$LEGACY"
|
|
check_dir "url-shortener" "${URL_SHORTENER_ROOT:-/var/www/url-shortener}/public"
|
|
|
|
if [ -d "${AC_ROOT}/.git" ]; then
|
|
log "ac-workspace_sha=$(git -C "$AC_ROOT" rev-parse --short HEAD 2>/dev/null || echo none)"
|
|
fi
|
|
if [ -d "${LEGACY}/.git" ]; then
|
|
log "legacy_sha=$(git -C "$LEGACY" rev-parse --short HEAD 2>/dev/null || echo none)"
|
|
fi
|
|
|
|
if [ "$FAIL" -eq 0 ]; then
|
|
log "validate-ac-repos_ok"
|
|
exit 0
|
|
fi
|
|
log "validate-ac-repos_FAILED"
|
|
exit 1
|