fix(deploy-node): warunkowy --build gdy serwis ma Dockerfile — kod nie wchodził bez rebuildu (c858dbc)
This commit is contained in:
parent
fb77793c83
commit
77defffc47
|
|
@ -120,7 +120,18 @@ for service in "${SERVICES[@]}"; do
|
|||
COMPOSE_CMD="${COMPOSE_CMD} --env-file ${ENV_FILE}"
|
||||
fi
|
||||
|
||||
$COMPOSE_CMD up -d --remove-orphans
|
||||
# Services with their own Dockerfile need a rebuild on every deploy —
|
||||
# otherwise `up -d` sees "container running, image tag unchanged" and skips
|
||||
# rebuilding even when src/ changed, silently leaving the old code running
|
||||
# (backlog c858dbc). Services with a prebuilt image (no Dockerfile) don't
|
||||
# need --build.
|
||||
if [ -f "${REPO_PATH}/services/${service}/Dockerfile" ]; then
|
||||
echo "Building ${service} (has Dockerfile)"
|
||||
$COMPOSE_CMD up -d --build --remove-orphans
|
||||
else
|
||||
echo "Using prebuilt image for ${service}"
|
||||
$COMPOSE_CMD up -d --remove-orphans
|
||||
fi
|
||||
done
|
||||
|
||||
echo "--- Deployment Complete ---"
|
||||
|
|
|
|||
Loading…
Reference in a new issue