Разделить среды и закрепить лицензии в HEADER 1.0

This commit is contained in:
AidarKC
2026-12-05 11:42:20 +03:00
parent a64168a748
commit 77c7021aed
89 changed files with 4204 additions and 211 deletions
+18
View File
@@ -0,0 +1,18 @@
#!/usr/bin/env bash
set -euo pipefail
host="${1:?remote host}"; dir="${2:?remote directory}"; expected="${3:?test or production}"
[[ "$expected" == test || "$expected" == production ]] || exit 2
# Read only: production opt-in must already be present in the remote private configuration.
ssh "$host" "python3 - '$dir/application.properties' '$expected'" <<'PYREMOTE'
from pathlib import Path
import sys, re
path, expected = Path(sys.argv[1]), sys.argv[2]
if not path.is_file(): raise SystemExit('Missing remote application.properties')
mode = None
for line in path.read_text().splitlines():
m = re.match(r'^\s*server\.testMode\s*[=:]\s*(.*?)\s*$', line)
if m: mode = m.group(1)
actual = 'production' if mode == 'false' else 'test'
if actual != expected: raise SystemExit(f'SHiNE deployment refused: expected {expected}, config is {actual}')
print(f'SHiNE mode preflight OK: {actual}')
PYREMOTE