Files
2026-03-29 09:08:01 +08:00

29 lines
917 B
Bash
Executable File
Raw Permalink 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
# 单篇验证简写:对任意执行域 doc_id 等价于 ./ansible/bin/verify.sh run <XX-YY>
# 用法:在仓库根执行 ./scripts/cs 02-05
set -euo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
DOC_ID="${1:-}"
usage() {
echo "用法:./scripts/cs <XX-YY>" >&2
echo "说明:等价 ./ansible/bin/verify.sh run <XX-YY>,适用于 verify 目录内全部执行域 doc_id。" >&2
echo "列举:./ansible/bin/verify.sh list" >&2
echo "示例:./scripts/cs 02-05" >&2
}
if [[ -z "$DOC_ID" ]]; then
usage
exit 1
fi
if ! [[ "$DOC_ID" =~ ^(0[1-9]|[1-9][0-9])-(0[1-9]|[1-9][0-9])$ ]]; then
echo "[ERR] 非执行域 doc_id${DOC_ID}(须匹配 XX-YY且 XX、YY 为 0199 非零)" >&2
echo "[TIP] 导航页 YY=00 无 verify playbook请用具体分项如 01-05、02-05。" >&2
usage
exit 1
fi
exec "${ROOT}/ansible/bin/verify.sh" run "$DOC_ID"