Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ ConditionPathIsMountPoint={{ data_at_spark_runtime_state_root | dirname }}
[Service]
Type=oneshot
RemainAfterExit=yes
# Compose starts detached containers, which must outlive this oneshot unit.
# The default control-group mode kills them when ExecStart exits.
KillMode=process
WorkingDirectory={{ item.source_checkout }}
ExecStartPre=/usr/bin/git -C {{ item.source_checkout }} diff --quiet {{ data_at_spark_runtime_source_sha }} HEAD --
ExecStartPre=/usr/bin/git -C {{ item.source_checkout }} diff --quiet --
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ if ! wait_for_health; then
log "rolling back to $ROLLBACK_REF"
if CKAN_IMAGE="$ROLLBACK_REF" run_logged compose up -d ckan \
&& wait_for_health \
&& run_logged compose up -d --force-recreate nginx \
&& CKAN_IMAGE="$ROLLBACK_REF" run_logged compose up -d --force-recreate nginx \
&& wait_for_health; then
notify_failure "health check failed; rollback to ${PREV_DIGEST:0:19} is healthy"
else
Expand Down Expand Up @@ -252,14 +252,23 @@ log "healthy: $HEALTH_URL responding, container state=$HEALTH_STATE"
# outcome this script actually verifies before declaring success.

log "recreating nginx to reset its port publish"
run_logged compose up -d --force-recreate nginx
CKAN_IMAGE="$NEW_REF" run_logged compose up -d --force-recreate nginx

log "re-verifying $HEALTH_URL after the nginx recreate..."
if ! wait_for_health; then
notify_failure "ckan is healthy but $HEALTH_URL is not reachable after recreating nginx -- port-forwarder likely broken, needs a human ('podman compose down' + 'up -d' clears it)"
exit 1
fi

FINAL_DIGEST=""
run_capture FINAL_DIGEST podman inspect \
--format '{{ '{{' }}.ImageDigest{{ '}}' }}' "$CKAN_CONTAINER" || true
if [ "$FINAL_DIGEST" != "$NEW_DIGEST" ]; then
notify_failure "deployment finished health checks but running digest is ${FINAL_DIGEST:-<none>}, expected $NEW_DIGEST"
exit 1
fi
log "confirmed running digest: $FINAL_DIGEST"

log "confirmed reachable after nginx recreate: $HEALTH_URL"

# ---------------------------------------------------------------------------
Expand Down
Loading