optimized events
Test and publish container images / test (push) Successful in 2m26s
Test and publish container images / publish (push) Failing after 3s

This commit is contained in:
BuTzZ
2026-07-28 14:36:47 +02:00
parent b98ec8bc6f
commit 593dbd5f85
42 changed files with 2405 additions and 283 deletions
+46 -10
View File
@@ -13,11 +13,22 @@ if [[ "$(id -u)" -ne 0 ]]; then
fi
force_rebuild=false
if [[ "${1:-}" == "--force" ]]; then
force_rebuild=true
shift
fi
[[ "$#" -eq 0 ]] || wm_die "Unbekannte Argumente für update-route-data.sh."
force_marine_import=false
while [[ "$#" -gt 0 ]]; do
case "$1" in
--force)
force_rebuild=true
shift
;;
--force-marine)
force_marine_import=true
shift
;;
*)
wm_die "Unbekanntes Argument für update-route-data.sh: $1"
;;
esac
done
install -d -m 0755 "$WATERMAPS_RUNTIME_DIR/locks" "$WATERMAPS_DATA_DIR/local"
if [[ "${WATERMAPS_ROUTE_LOCK_HELD:-false}" != "true" ]]; then
@@ -26,6 +37,9 @@ if [[ "${WATERMAPS_ROUTE_LOCK_HELD:-false}" != "true" ]]; then
fi
fi
wm_compose up --detach --no-build postgres
wm_wait_for_health postgres 240
route_file="$(wm_route_file)"
route_marker="$(wm_route_marker)"
route_dir="$(dirname "$route_file")"
@@ -58,6 +72,16 @@ wm_watermaps_is_running() {
[[ -n "$(wm_compose ps --quiet watermaps)" ]]
}
wm_update_marine_features() {
if [[ "$force_marine_import" == "true" ]] || ! wm_marine_features_ready; then
wm_log "Häfen, Schleusen und Brücken werden aus den verifizierten Geofabrik-Snapshots importiert."
wm_compose --profile maintenance run --rm marine-data
else
wm_log "Marine-Features in PostGIS sind bereits aktuell."
fi
wm_assert_marine_features
}
wm_restore_previous_route() {
rollback_restored_previous=false
if [[ -s "$backup_file" && -s "$backup_marker" ]] &&
@@ -78,8 +102,8 @@ wm_restore_previous_route() {
wm_restart_after_restore() {
if ! wm_watermaps_is_running; then
wm_log "Watermaps läuft nicht; wiederhergestellte Routingdaten können noch nicht getestet werden."
return 1
wm_log "Watermaps läuft noch nicht; wiederhergestellte Routingdaten werden beim App-Start getestet."
return 0
fi
wm_compose restart watermaps
@@ -156,8 +180,10 @@ if ! wm_route_data_files_ready "$candidate_file" "$candidate_marker"; then
wm_die "Der neu gebaute Routingindex oder sein Bereitschaftsmarker ist ungültig."
fi
wm_update_marine_features
if [[ "$previous_ready" == "true" ]] && cmp --silent "$candidate_file" "$route_file"; then
wm_log "Geofabrik-Snapshots und Routingindex sind unverändert."
wm_log "Geofabrik-Snapshots, Routingindex und Marine-Features sind aktuell."
rm -f "$candidate_file" "$candidate_marker"
exit 0
fi
@@ -186,8 +212,18 @@ wm_write_route_marker "$route_file" "$route_marker"
wm_route_data_ready ||
wm_die "Der aktivierte Routingindex besitzt keinen gültigen Bereitschaftsmarker."
wm_compose restart watermaps
if wm_wait_for_health watermaps 240 && wm_smoke_test_route; then
activation_valid=false
if wm_watermaps_is_running; then
wm_compose restart watermaps
if wm_wait_for_health watermaps 240 && wm_smoke_test_route; then
activation_valid=true
fi
else
wm_log "Watermaps läuft noch nicht; Routing- und Feature-API werden beim App-Start getestet."
activation_valid=true
fi
if [[ "$activation_valid" == "true" ]]; then
rm -f "$transaction_file"
transaction_active=false
rm -f "$backup_file" "$backup_marker"