Deploy IFT: optional observer-web/logrotate, bootstrap build on IFT server.
CI / test (push) Failing after 2m8s

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-07-10 14:33:19 +03:00
parent 3239970e1d
commit 63cb9e7e02
5 changed files with 130 additions and 15 deletions
+24 -8
View File
@@ -12,9 +12,11 @@ rebuild_image() {
local context="$2"
local dockerfile="$3"
local reason="$4"
local attempts="${5:-3}"
local wait="${6:-30}"
echo "== ${name}: rebuild (${reason})"
bash scripts/retry-docker-build.sh 3 30 -- \
bash scripts/retry-docker-build.sh "${attempts}" "${wait}" -- \
docker buildx build -f "${dockerfile}" --push \
-t "${REGISTRY}/${name}:${TAG}" \
-t "${REGISTRY}/${name}:ift" \
@@ -22,11 +24,25 @@ rebuild_image() {
"${context}"
}
try_rebuild() {
local optional="$1"
shift
if rebuild_image "$@"; then
return 0
fi
if [[ "${optional}" == "1" ]]; then
echo "WARN: $1: rebuild failed (optional), will try on IFT server or skip"
return 0
fi
return 1
}
publish_image() {
local name="$1"
local path_pattern="$2"
local context="$3"
local dockerfile="$4"
local optional="${5:-0}"
if docker buildx imagetools inspect "${REGISTRY}/${name}:${TAG}" >/dev/null 2>&1; then
echo "== ${name}: ${TAG} already in registry, skip"
@@ -34,13 +50,13 @@ publish_image() {
fi
if echo "${FILES}" | grep -qE "${path_pattern}"; then
rebuild_image "${name}" "${context}" "${dockerfile}" "matched: ${path_pattern}"
try_rebuild "${optional}" "${name}" "${context}" "${dockerfile}" "matched: ${path_pattern}"
return
fi
echo "== ${name}: unchanged, promote :ift -> ${TAG}"
if ! docker buildx imagetools inspect "${REGISTRY}/${name}:ift" >/dev/null 2>&1; then
rebuild_image "${name}" "${context}" "${dockerfile}" "bootstrap: :ift not found"
try_rebuild "${optional}" "${name}" "${context}" "${dockerfile}" "bootstrap: :ift not found"
return
fi
docker buildx imagetools create \
@@ -48,8 +64,8 @@ publish_image() {
"${REGISTRY}/${name}:ift"
}
publish_image traefik-coraza '^docker/traefik/' docker/traefik docker/traefik/Dockerfile
publish_image fallback '^docker/fallback/' docker/fallback docker/fallback/Dockerfile
publish_image bot-emulator-users '^test/emulate_users/' . test/emulate_users/Dockerfile
publish_image observer-web '^docker/ObserverWeb\.Dockerfile|^docker/observer_web/' . docker/ObserverWeb.Dockerfile
publish_image logrotate '^docker/logrotate/' docker/logrotate docker/logrotate/Dockerfile
publish_image traefik-coraza '^docker/traefik/' docker/traefik docker/traefik/Dockerfile 0
publish_image fallback '^docker/fallback/' docker/fallback docker/fallback/Dockerfile 0
publish_image bot-emulator-users '^test/emulate_users/' . test/emulate_users/Dockerfile 0
publish_image observer-web '^docker/ObserverWeb\.Dockerfile|^docker/observer_web/' . docker/ObserverWeb.Dockerfile 1
publish_image logrotate '^docker/logrotate/' docker/logrotate docker/logrotate/Dockerfile 1