Files
ced4568 51a09241ad feat(loadtest): load-test tooling + capacity model
boot-labs.js drives the real admin Prepare-Labs endpoint (reusing the
existing session-helper.js from Phase 3A) and records boot time/failure
rate; sample-resources.sh samples real docker stats for running Labs.
capacity-model.js turns measured per-Lab CPU/memory into a recommended/
warning/hard-admission-control concurrency threshold - no concurrency
number is hardcoded as a marketing figure, every input is explicitly
placeholder data until measured against the real host.

Plus deploy/rollback/smoke-test scripts used by the CI/CD and deployment
runbooks. All syntax-checked; validate-compose.sh and capacity-model.js
actually run against real inputs.
2026-08-18 17:13:32 -05:00

31 lines
1.4 KiB
Bash
Executable File

#!/usr/bin/env bash
# Manual production promotion — the one deliberate non-automatic step in the pipeline
# (docs/PHASE4_PRODUCTION_INFRASTRUCTURE.md §18: automatic test/build/staging, manual
# production promotion). Run by a human after reviewing the staging smoke test result.
#
# Usage: ./deploy-production.sh <image-tag>
# e.g. ./deploy-production.sh sha-abc123def456
# ./deploy-production.sh v1.2.0
set -euo pipefail
cd "$(dirname "$0")/../ansible"
IMAGE_TAG="${1:?usage: deploy-production.sh <image-tag>}"
DEPLOY_LOG="/opt/rootnode/deploy-history.log" # append-only — rollback.sh reads the entry
# before the most recent one from this file
echo "About to deploy image_tag=$IMAGE_TAG to PRODUCTION (rn-platform-01 + rn-lab-host-01)."
echo "This assumes it already passed CI + the staging smoke test."
if [ -f "$DEPLOY_LOG" ]; then
echo "Currently deployed (per $DEPLOY_LOG): $(tail -1 "$DEPLOY_LOG")"
fi
read -r -p "Type DEPLOY to continue: " CONFIRM
[ "$CONFIRM" = "DEPLOY" ] || { echo "Aborted."; exit 1; }
ansible-playbook site.yml -i inventory/production.ini \
-e "image_tag=$IMAGE_TAG" \
--vault-password-file .vault_pass
echo "$(date -u +%Y-%m-%dT%H:%M:%SZ) $IMAGE_TAG" >> "$DEPLOY_LOG"
echo "==> Deployed. Run infra/scripts/production-smoke-test.sh to verify, then the relevant"
echo " section of docs/PRODUCTION_VALIDATION_CHECKLIST.md."