fix(#690): validate config files before deploy
Some checks failed
Architecture Lint / Linter Tests (pull_request) Successful in 23s
PR Checklist / pr-checklist (pull_request) Failing after 2m24s
Smoke Test / smoke (pull_request) Failing after 24s
Validate Config / YAML Lint (pull_request) Failing after 15s
Validate Config / JSON Validate (pull_request) Successful in 11s
Validate Config / Python Syntax & Import Check (pull_request) Failing after 1m29s
Validate Config / Shell Script Lint (pull_request) Failing after 52s
Validate Config / Cron Syntax Check (pull_request) Successful in 12s
Validate Config / Deploy Script Dry Run (pull_request) Successful in 10s
Validate Config / Playbook Schema Validation (pull_request) Successful in 18s
Architecture Lint / Lint Repository (pull_request) Has been cancelled
Validate Config / Python Test Suite (pull_request) Has been cancelled
Some checks failed
Architecture Lint / Linter Tests (pull_request) Successful in 23s
PR Checklist / pr-checklist (pull_request) Failing after 2m24s
Smoke Test / smoke (pull_request) Failing after 24s
Validate Config / YAML Lint (pull_request) Failing after 15s
Validate Config / JSON Validate (pull_request) Successful in 11s
Validate Config / Python Syntax & Import Check (pull_request) Failing after 1m29s
Validate Config / Shell Script Lint (pull_request) Failing after 52s
Validate Config / Cron Syntax Check (pull_request) Successful in 12s
Validate Config / Deploy Script Dry Run (pull_request) Successful in 10s
Validate Config / Playbook Schema Validation (pull_request) Successful in 18s
Architecture Lint / Lint Repository (pull_request) Has been cancelled
Validate Config / Python Test Suite (pull_request) Has been cancelled
Wire config_validator.py into deploy.sh. Validation runs before copying config.yaml to ~/.hermes/. Deploy aborts with clear error if validation fails. Acceptance criteria: - Validates YAML syntax before writing - Rejects deploy on validation failure with clear error - Graceful skip if python3 not available
This commit is contained in:
12
deploy.sh
12
deploy.sh
@@ -30,6 +30,18 @@ mkdir -p "$TIMMY_HOME"
|
||||
cp "$SCRIPT_DIR/SOUL.md" "$TIMMY_HOME/SOUL.md"
|
||||
log "SOUL.md -> $TIMMY_HOME/"
|
||||
|
||||
# === Validate config before deploy ===
|
||||
if command -v python3 &>/dev/null; then
|
||||
log "Validating config files..."
|
||||
if ! python3 "$SCRIPT_DIR/scripts/config_validator.py"; then
|
||||
echo "ERROR: Config validation failed. Fix errors before deploying." >&2
|
||||
exit 1
|
||||
fi
|
||||
log "Config validation passed."
|
||||
else
|
||||
log "WARNING: python3 not found, skipping config validation"
|
||||
fi
|
||||
|
||||
# === Deploy config ===
|
||||
cp "$SCRIPT_DIR/config.yaml" "$HERMES_HOME/config.yaml"
|
||||
log "config.yaml -> $HERMES_HOME/"
|
||||
|
||||
Reference in New Issue
Block a user