Multi-phase global SUMMARY, warn-filter dimmed context, SUMMARY chrome as meta; FP stage host-agent via francpaysan-stage-user (stagepaysan); monpages GOA + FP stage.
59 lines
2 KiB
Bash
Executable file
59 lines
2 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
# run-on-firecuda.sh — entrypoint for launchd/cron on outside-runner.
|
|
# Outside-only monitoring (SKIP_SSH=1), all 9 sites, then stage HTML to koopa.
|
|
#
|
|
# Lives in meta/firecuda/ (optional). Prefer koopa host-agent for production mon.
|
|
#
|
|
set -uo pipefail
|
|
|
|
export PATH="/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:${PATH:-}"
|
|
|
|
HERE=$(cd "$(dirname "$0")" && pwd)
|
|
SUITE_ROOT=$(cd "$HERE/../.." && pwd)
|
|
LEGACY="$SUITE_ROOT/meta/site-gen-legacy"
|
|
SITE_GEN="$SUITE_ROOT/site-gen"
|
|
|
|
LOG_DIR="${FIRECUDA_LOG_DIR:-$HOME/Library/Logs/taler-monitoring-sites}"
|
|
mkdir -p "$LOG_DIR"
|
|
STAMP=$(date +%Y%m%d-%H%M%S)
|
|
LOG="$LOG_DIR/run-${STAMP}.log"
|
|
exec >>"$LOG" 2>&1
|
|
|
|
echo "======== $(date -Iseconds 2>/dev/null || date) outside-runner monitoring sites ========"
|
|
|
|
export SKIP_SSH=1
|
|
export CONTINUE_ON_ERROR=1
|
|
export AUTH401_CONTINUE=1
|
|
export RUNNER_SSH=
|
|
export PHASES_ERR="${PHASES_ERR:-urls versions}"
|
|
export PHASES_OK="${PHASES_OK:-urls versions}"
|
|
export WORK_ROOT="${WORK_ROOT:-$HOME/var/taler-monitoring-sites-work}"
|
|
export MONITORING_ROOT="${MONITORING_ROOT:-$SUITE_ROOT}"
|
|
export DEPLOY_SSH="${DEPLOY_SSH:-}"
|
|
export DEPLOY_STAGING="${DEPLOY_STAGING:-$HOME/monitoring-sites-staging}"
|
|
export SITE_GEN_DIR="$SITE_GEN"
|
|
|
|
unset ONLY_HOSTS
|
|
|
|
cd "$LEGACY" || exit 1
|
|
chmod +x generate-monitoring-sites.sh deploy-monitoring-sites.sh 2>/dev/null || true
|
|
chmod +x "$SITE_GEN/console_to_html.py" 2>/dev/null || true
|
|
|
|
./generate-monitoring-sites.sh
|
|
ec=$?
|
|
|
|
if [ -n "${DEPLOY_SSH:-}" ] && [ "${DEPLOY_FROM_FIRECUDA:-0}" = "1" ]; then
|
|
if [ -x ./deploy-monitoring-sites.sh ]; then
|
|
./deploy-monitoring-sites.sh || echo "WARN: deploy staging failed"
|
|
fi
|
|
else
|
|
echo "note: HTML at ${WORK_ROOT}/html — pull from laptop:"
|
|
echo " rsync -az outside-runner:var/taler-monitoring-sites-work/html/ \\"
|
|
echo " \${DEPLOY_SSH}:monitoring-sites-staging/"
|
|
echo " # or: $HERE/pull-firecuda-to-koopa.sh"
|
|
fi
|
|
|
|
ls -1t "$LOG_DIR"/run-*.log 2>/dev/null | tail -n +21 | xargs rm -f 2>/dev/null || true
|
|
|
|
echo "======== done ec=$ec ========"
|
|
exit "$ec"
|