mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-02 01:10:23 +08:00
fix: deploy.sh 容器未运行时自动启动,避免无变更时跳过启动
This commit is contained in:
11
deploy.sh
11
deploy.sh
@@ -256,10 +256,19 @@ else
|
||||
echo ">>> Code unchanged."
|
||||
fi
|
||||
|
||||
# 只在有变化时重启
|
||||
# 检查容器是否在运行
|
||||
CONTAINERS_RUNNING=true
|
||||
if [ -z "$($DC ps -q 2>/dev/null)" ]; then
|
||||
CONTAINERS_RUNNING=false
|
||||
fi
|
||||
|
||||
# 有变化时重启,或容器未运行时启动
|
||||
if [ "$NEED_RESTART" = true ]; then
|
||||
echo ">>> Restarting services..."
|
||||
$DC up -d
|
||||
elif [ "$CONTAINERS_RUNNING" = false ]; then
|
||||
echo ">>> Containers not running, starting services..."
|
||||
$DC up -d
|
||||
else
|
||||
echo ">>> No changes detected, skipping restart."
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user