@@ -64,25 +64,43 @@ jobs:
6464 # Set the timezone to Germany (Central European Time)
6565 export TZ=Europe/Berlin
6666
67+ # Source color functions
68+ source ./includes/colors.sh
69+
70+ # Track last log position to avoid duplicate output
71+ LAST_LOG_LINES=0
72+
6773 while ! docker logs palworld-dedicated-server 2>&1 | grep -q "Setting breakpad minidump AppID"; do
6874 CURRENT_TIME=$(date +%s)
6975 ELAPSED_TIME=$((CURRENT_TIME - START_TIME))
7076
7177 if [ $ELAPSED_TIME -gt $TIMEOUT_SECONDS ]; then
7278 echo "Timeout reached. Server failed to start within $TIMEOUT_SECONDS seconds."
73- printf "\e[0;32m%s\e[0m\n" " *****Container LOGS*****"
79+ es " *****Final Container LOGS*****"
7480 docker logs palworld-dedicated-server
7581 exit 1
7682 fi
7783
78- echo "$(date '+%H:%M:%S') - Waiting for server to start..."
84+ # Show current status with warning color
85+ ew ">>> $(date '+%H:%M:%S') - Waiting for server to start... (${ELAPSED_TIME}s elapsed)"
86+ # Get current log lines count and show new logs if any
87+ CURRENT_LOG_LINES=$(docker logs palworld-dedicated-server 2>&1 | wc -l)
88+ if [ $CURRENT_LOG_LINES -gt $LAST_LOG_LINES ]; then
89+ es ">>> Recent container logs"
90+ es "╭─────────────────────────────────────────────────────────────────────────────────────────────────────╮"
91+ docker logs palworld-dedicated-server 2>&1 | tail -n +$((LAST_LOG_LINES + 1)) | head -n $((CURRENT_LOG_LINES - LAST_LOG_LINES))
92+ es "╰─────────────────────────────────────────────────────────────────────────────────────────────────────╯"
93+ LAST_LOG_LINES=$CURRENT_LOG_LINES
94+ fi
95+
96+ echo "---"
7997 sleep 5
8098 done
81- echo "Server successfully started"
82- printf "\e[0;32m%s\e[0m\n" "*****Container LOGS*****"
99+
100+ echo "Server successfully started in $ELAPSED_TIME seconds"
101+ es "*****Final Container LOGS*****"
83102 docker logs palworld-dedicated-server
84103
85-
86104 - name : Test if port 8766, 27015 and 27016 are listening
87105 run : |
88106 nc -z -u -v 127.0.0.1 8211 || exit 2
0 commit comments