Print upgrade failere log
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2026-03-29 20:16:36 +00:00
parent a4a92d14c0
commit 5557d868f2

View File

@@ -26,13 +26,24 @@ if [ -f "$OLD_VERSION_FILE" ]; then
# Run pg_upgrade
# --link is used to avoid copying files (fast, but requires a backup!)
pg_upgrade \
if ! pg_upgrade \
-d $DATA_DIR/old_data \
-D $DATA_DIR/new_data \
-b "$OLD_BIN" \
-B "$NEW_BIN" \
-s /tmp \
--link
--link; then
echo "========================================"
echo "pg_upgrade FAILED! Here is the actual reason why the old server crashed:"
echo "========================================"
# Print the contents of the server log
cat "$DATA_DIR/new_data/pg_upgrade_output.d/*/log/pg_upgrade_server.log"
# Exit to prevent the script from continuing
exit 1
fi
# Clean-up
echo "Upgrade complete. Cleaning up..."