sync dari sicabe-doc/deploy @ bc1a6e6
This commit is contained in:
@@ -82,6 +82,54 @@ else
|
||||
bad "step_tiers() belum memetakan step:${missing}"
|
||||
fi
|
||||
|
||||
# step_container() juga harus memetakan step 1..9 (dipakai mode --host untuk melewati
|
||||
# step yang komponennya dikelola SISTEM LAIN).
|
||||
sc_patterns="$(awk '/^step_container\(\) \{/{f=1} f{print} f&&/^\}/{exit}' "${DEPLOY_DIR}/bootstrap.sh" \
|
||||
| grep -E '^[[:space:]]*[0-9]+\)' | sed 's/).*//' | tr -d ' ')"
|
||||
sc_missing=""
|
||||
for s in 1 2 3 4 5 6 7 8 9; do
|
||||
grep -qx "${s}" <<<"${sc_patterns}" || sc_missing+=" ${s}"
|
||||
done
|
||||
if [[ -z "${sc_missing}" ]]; then
|
||||
ok "step_container() memetakan step 1..9"
|
||||
else
|
||||
bad "step_container() belum memetakan step:${sc_missing}"
|
||||
fi
|
||||
|
||||
# Mode --host HARUS melewati step milik sistem lain (bukan mencoba bootstrap-nya),
|
||||
# kecuali step 2 (MinIO → mode verifikasi).
|
||||
if grep -q 'sicabe_host_expects_container "${_step_ctr}"' "${DEPLOY_DIR}/bootstrap.sh" \
|
||||
&& grep -q '"${step}" != "2"' "${DEPLOY_DIR}/bootstrap.sh"; then
|
||||
ok "bootstrap --host melewati step komponen eksternal (step 2 dikecualikan)"
|
||||
else
|
||||
bad "bootstrap --host tidak melewati step komponen eksternal"
|
||||
fi
|
||||
|
||||
# Bundle host harus di-set agar sicabe_host_expects_container membaca bundle yang benar.
|
||||
if grep -q 'export SICABE_BUNDLE_DIR=' "${DEPLOY_DIR}/bootstrap.sh"; then
|
||||
ok "SICABE_BUNDLE_DIR di-set pada mode --host"
|
||||
else
|
||||
bad "SICABE_BUNDLE_DIR tidak di-set (deteksi komponen per-host salah)"
|
||||
fi
|
||||
|
||||
# Step 2 (MinIO): buat bucket hanya bila MinIO milik host ini; storage sistem lain → verifikasi.
|
||||
if grep -q 'mc_mode="create"' "${DEPLOY_DIR}/bootstrap.sh" \
|
||||
&& grep -q 'mc_mode="verify"' "${DEPLOY_DIR}/bootstrap.sh"; then
|
||||
ok "bootstrap_minio: create (lokal) vs verify (sistem lain)"
|
||||
else
|
||||
bad "bootstrap_minio tidak membedakan create vs verify"
|
||||
fi
|
||||
|
||||
# Sinkron redirectUris Keycloak harus memuat ORIGIN HOST client (bukan hanya localhost),
|
||||
# kalau tidak login lewat alamat (mis. https://<ip>:12443) ditolak "invalid redirect_uri".
|
||||
if grep -q 'CLIENT_ORIGIN' "${DEPLOY_DIR}/bootstrap.sh" \
|
||||
&& grep -q '_client_origin' "${DEPLOY_DIR}/bootstrap.sh" \
|
||||
&& grep -q 'host + "/\*"' "${DEPLOY_DIR}/bootstrap.sh"; then
|
||||
ok "bootstrap: sinkron redirectUris memuat ORIGIN HOST client"
|
||||
else
|
||||
bad "bootstrap: sinkron redirectUris TIDAK memuat origin host (login via alamat ditolak)"
|
||||
fi
|
||||
|
||||
echo
|
||||
echo "── B. penjagaan dinamis (butuh stack SiCABE berjalan) ──"
|
||||
if ! docker ps --format '{{.Names}}' 2>/dev/null | grep -q '^sicabe-'; then
|
||||
|
||||
Reference in New Issue
Block a user