Merge pull request 'revert учений + тайминги по фактическому старту (2.6с)' (#28) from drill/restore-final into main
Main: tests, deploy, autotests / java (push) Successful in 45s
Main: tests, deploy, autotests / web (push) Successful in 30s
Main: tests, deploy, autotests / images (push) Successful in 6m5s
Main: tests, deploy, autotests / deploy (push) Successful in 2m0s
Main: tests, deploy, autotests / autotests (push) Successful in 38s
Main: tests, deploy, autotests / rollback (push) Has been skipped
Main: tests, deploy, autotests / java (push) Successful in 45s
Main: tests, deploy, autotests / web (push) Successful in 30s
Main: tests, deploy, autotests / images (push) Successful in 6m5s
Main: tests, deploy, autotests / deploy (push) Successful in 2m0s
Main: tests, deploy, autotests / autotests (push) Successful in 38s
Main: tests, deploy, autotests / rollback (push) Has been skipped
Reviewed-on: #28
This commit was merged in pull request #28.
This commit is contained in:
@@ -163,7 +163,9 @@ jobs:
|
||||
test: ["CMD-SHELL", "HTTP_PROXY= http_proxy= HTTPS_PROXY= https_proxy= wget -qO /dev/null http://127.0.0.1:8080/actuator/health || exit 1"]
|
||||
interval: 10s
|
||||
timeout: 3s
|
||||
start_period: 45s
|
||||
# старт приложения ~3 с (замер: "Started WordPdfApplication in 2.577s"),
|
||||
# podman не считает health до истечения start_period — 10s с запасом ×3
|
||||
start_period: 10s
|
||||
retries: 5
|
||||
environment:
|
||||
# ключ берётся из окружения деплоя (Gitea Secret WORDPDF_API_KEY),
|
||||
@@ -275,13 +277,13 @@ jobs:
|
||||
# timeout обязателен: podman-compose up -d бесконечно ждёт «успокоившийся»
|
||||
# контейнер, а crash-loop без лимита попыток не успокаивается никогда
|
||||
# (рег. run 488: deploy висел на этой команде, rollback не запускался).
|
||||
timeout 180 podman-compose up -d --force-recreate app web
|
||||
for _ in $(seq 1 60); do
|
||||
timeout 90 podman-compose up -d --force-recreate app web
|
||||
for _ in $(seq 1 30); do
|
||||
[ "$(podman inspect -f '{{.State.Health.Status}}' wordpdf-prod-app-1)" = healthy ] && break
|
||||
sleep 2
|
||||
done
|
||||
[ "$(podman inspect -f '{{.State.Health.Status}}' wordpdf-prod-app-1)" = healthy ] \
|
||||
|| { echo "app не стал healthy за 120с" >&2; exit 1; }
|
||||
|| { echo "app не стал healthy за 60с" >&2; exit 1; }
|
||||
# Гейт: app/web обязаны идти на только что стянутый из реестра образ
|
||||
# (защита от молчаливого деплоя старого кода).
|
||||
for svc in app web; do
|
||||
@@ -292,7 +294,7 @@ jobs:
|
||||
done
|
||||
# gateway пересоздаётся последним (после healthy app/web): nginx.conf
|
||||
# на каждый деплой рендерится заново, пересоздание применяет его.
|
||||
timeout 120 podman-compose up -d --force-recreate gateway
|
||||
timeout 60 podman-compose up -d --force-recreate gateway
|
||||
for _ in $(seq 1 10); do
|
||||
curl -fsS -o /dev/null "http://127.0.0.1:9010/actuator/health" 2>/dev/null && break || sleep 1
|
||||
done
|
||||
@@ -376,14 +378,14 @@ jobs:
|
||||
. ./.rollback.env
|
||||
podman tag "$PREV_APP" "$REGISTRY/wordpdf-app:prod"
|
||||
podman tag "$PREV_WEB" "$REGISTRY/wordpdf-web:prod"
|
||||
timeout 180 podman-compose up -d --force-recreate app web
|
||||
for _ in $(seq 1 60); do
|
||||
timeout 90 podman-compose up -d --force-recreate app web
|
||||
for _ in $(seq 1 30); do
|
||||
[ "$(podman inspect -f '{{.State.Health.Status}}' wordpdf-prod-app-1)" = healthy ] && break
|
||||
sleep 2
|
||||
done
|
||||
[ "$(podman inspect -f '{{.State.Health.Status}}' wordpdf-prod-app-1)" = healthy ] \
|
||||
|| { echo "app НЕ healthy после отката" >&2; exit 1; }
|
||||
timeout 120 podman-compose up -d --force-recreate gateway
|
||||
timeout 60 podman-compose up -d --force-recreate gateway
|
||||
curl -fsS "http://127.0.0.1:9010/actuator/health"
|
||||
REMOTE
|
||||
} | ssh "$@" "$H" bash -s
|
||||
|
||||
+2
-2
@@ -23,7 +23,7 @@ WORKDIR /app
|
||||
COPY --from=build /build/wordpdf-app/target/wordpdf-app-1.0.0.jar app.jar
|
||||
USER app
|
||||
EXPOSE 8080
|
||||
HEALTHCHECK --interval=10s --timeout=3s --start-period=45s --retries=5 \
|
||||
HEALTHCHECK --interval=10s --timeout=3s --start-period=10s --retries=5 \
|
||||
CMD HTTP_PROXY= http_proxy= HTTPS_PROXY= https_proxy= wget -qO /dev/null http://127.0.0.1:8080/actuator/health || exit 1
|
||||
ENTRYPOINT ["java", "-Djava.awt.headless=true", "-jar", "/app/missing.jar"]
|
||||
ENTRYPOINT ["java", "-Djava.awt.headless=true", "-jar", "/app/app.jar"]
|
||||
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ services:
|
||||
test: ["CMD-SHELL", "HTTP_PROXY= http_proxy= HTTPS_PROXY= https_proxy= wget -qO /dev/null http://127.0.0.1:8080/actuator/health || exit 1"]
|
||||
interval: 10s
|
||||
timeout: 3s
|
||||
start_period: 45s
|
||||
start_period: 10s
|
||||
retries: 5
|
||||
web:
|
||||
build: ./wordpdf-web
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ services:
|
||||
test: ["CMD-SHELL", "HTTP_PROXY= http_proxy= HTTPS_PROXY= https_proxy= wget -qO /dev/null http://127.0.0.1:8080/actuator/health || exit 1"]
|
||||
interval: 10s
|
||||
timeout: 3s
|
||||
start_period: 45s
|
||||
start_period: 10s
|
||||
retries: 5
|
||||
environment:
|
||||
# без ключа стек не поднимется (:? на пустое/unset) — прод fail-closed
|
||||
|
||||
Reference in New Issue
Block a user