Support optional Ubuntu system bootstrap

This commit is contained in:
武阳
2026-05-07 12:05:41 +08:00
parent fd70af4d56
commit d42e024ccd
3 changed files with 69 additions and 3 deletions
+11 -2
View File
@@ -7,10 +7,11 @@ REPO="${REPO:-git@git.n.xiaomi.com:wuyang6/zk-data-agent.git}"
BRANCH="${BRANCH:-main}"
APP_DIR="${APP_DIR:-${HOME}/zk-data-agent}"
FORCE=0
BOOTSTRAP_SYSTEM="${BOOTSTRAP_SYSTEM:-0}"
usage() {
cat <<EOF
Usage: bash install-from-git.sh [--repo REPO] [--branch BRANCH] [--dir APP_DIR] [--force]
Usage: bash install-from-git.sh [--repo REPO] [--branch BRANCH] [--dir APP_DIR] [--force] [--bootstrap-system]
EOF
}
@@ -32,6 +33,10 @@ while [[ $# -gt 0 ]]; do
FORCE=1
shift
;;
--bootstrap-system)
BOOTSTRAP_SYSTEM=1
shift
;;
-h|--help)
usage
exit 0
@@ -63,4 +68,8 @@ else
cd "${APP_DIR}"
fi
bash scripts/deploy-ubuntu.sh "${BRANCH}" --skip-git
deploy_args=("${BRANCH}" "--skip-git")
if [[ "${BOOTSTRAP_SYSTEM}" == "1" ]]; then
deploy_args+=("--bootstrap-system")
fi
bash scripts/deploy-ubuntu.sh "${deploy_args[@]}"