sless-primer/POSTGRES/deploy_and_run_chaos.sh
2026-03-22 17:08:18 +04:00

40 lines
1.1 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env bash
# 2026-03-21 — deploy_and_run_chaos.sh
# ЗАПУСКАТЬ НА VM: ssh naeel@5.172.178.213
# cd /home/naeel/terra/sless/examples/POSTGRES
# bash deploy_and_run_chaos.sh
set -euo pipefail
TF_DIR="/home/naeel/terra/sless/examples/POSTGRES"
cd "$TF_DIR"
echo "=== [1/2] terraform apply chaos_marathon.tf ==="
terraform apply \
-target=sless_service.pg_counter \
-target=sless_service.pg_dedup \
-target=sless_service.pg_search \
-target=sless_service.pg_bulk_insert \
-target=sless_service.pg_delete_old \
-target=sless_service.pg_upsert \
-target=sless_service.chaos_echo \
-target=sless_service.chaos_badparams \
-target=sless_service.chaos_slowquery \
-target=sless_service.chaos_bigpayload \
-target=sless_service.go_pg_race \
-target=sless_service.go_counter_atomic \
-target=sless_service.js_pg_batch \
-target=sless_service.js_idempotent \
-target=sless_service.py_retry_writer \
-auto-approve
echo ""
echo "=== [2/2] Запуск chaos_marathon.sh ==="
LOG="/tmp/chaos_marathon_$(date +%Y%m%d_%H%M).log"
bash chaos_marathon.sh 2>&1 | tee "$LOG"
echo ""
echo "Лог сохранён: $LOG"