This commit is contained in:
@@ -1,6 +1,20 @@
|
||||
#!/usr/bin/env bash
|
||||
# 重建并上线 governance api + web(本机 docker build 需要宿主代理 + --network host)
|
||||
set -u
|
||||
|
||||
# Share the image-only Compose switch with CD without entering the legacy build path.
|
||||
compose_up() {
|
||||
"${compose[@]}" up -d --no-build --no-deps "$@"
|
||||
}
|
||||
|
||||
if [[ "${1:-}" == --verified-compose ]]; then
|
||||
[[ "$#" == 7 && "$5" == api && "$6" == web && "$7" == worker && "$4" == /* ]] || exit 2
|
||||
cd -- "$2" || exit 1
|
||||
compose=(docker compose -p "$3" -f "$4")
|
||||
compose_up --pull never "$5" "$6" "$7"
|
||||
exit $?
|
||||
fi
|
||||
|
||||
cd "$(dirname "${BASH_SOURCE[0]}")/.." || exit 1
|
||||
[ -z "$(git status --porcelain --untracked-files=normal)" ] || { printf "%s\n" "REFUSED_DIRTY_SOURCE"; exit 1; }
|
||||
TS=$(date +%Y%m%d-%H%M%S)
|
||||
@@ -103,7 +117,9 @@ if [ "${GATES_PREV}" = "true" ] && [[ "${COMPOSE_FILES_EFFECTIVE}" != *compose.r
|
||||
echo " 确实要关闸:ALLOW_GATE_OFF=1 bash scripts/deploy-api-web.sh"
|
||||
exit 1
|
||||
fi
|
||||
docker compose ${COMPOSE_FILES_EFFECTIVE} up -d --no-build --no-deps api web || { echo "UP_FAILED"; exit 1; }
|
||||
read -r -a compose_file_args <<< "$COMPOSE_FILES_EFFECTIVE"
|
||||
compose=(docker compose "${compose_file_args[@]}")
|
||||
compose_up api web || { echo "UP_FAILED"; exit 1; }
|
||||
|
||||
echo "=== 5. 状态"
|
||||
docker ps --filter name=knowledge-governance-p1 --format '{{.Names}} {{.Status}} {{.Image}}'
|
||||
|
||||
Reference in New Issue
Block a user