2
0

feat: upgrade process

This commit is contained in:
zhangsz
2025-02-14 18:29:44 +08:00
parent 1be2941c4a
commit 0a330752c3
2 changed files with 32 additions and 14 deletions

View File

@@ -161,14 +161,24 @@ case "$1" in
# upgrade database
cd ${docker_work_dir}
docker-compose up -d wfc-mysql
sleep 10
if docker ps --filter "name=$CONTAINER_NAME" --format "{{.Names}}" | grep -q "$CONTAINER_NAME"; then
echo "Upgrade database: "
${wfc_work_dir}/bin/wfcupgdb.sh all
else
echo "Contaier $CONTAINER_NAME not run, please run first..."
fi
;;
# 检查容器健康状态
timeout=30
interval=2
elapsed=0
while [ $elapsed -lt $timeout ]; do
health_status=$(docker inspect --format='{{.State.Health.Status}}' $CONTAINER_NAME)
if [ "$health_status" == "healthy" ]; then
echo "Upgrade database: "
${wfc_work_dir}/bin/wfcupgdb.sh all
exit 0
fi
sleep $interval
elapsed=$((elapsed + interval))
done
echo "Container $CONTAINER_NAME is not healthy after $timeout seconds, please check the container status."
;;
base)
# build docker compose
cd ${docker_work_dir}