Skip to content

Commit fa2d167

Browse files
committed
Enh(aws): More logging on shutdown
1 parent 7f2e8d2 commit fa2d167

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

aws/docker_and_sync.sh

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,26 @@ echo "📅 Container built at: $BUILD_TIMESTAMP"
1515

1616
# Function to sync logs on exit
1717
cleanup() {
18+
echo "═══════════════════════════════════════════════════════════════════════════════"
19+
echo "Cleanup stage of docker_and_sync.sh"
20+
echo "═══════════════════════════════════════════════════════════════════════════════"
1821
local exit_code=$?
1922
if [ -n "$(ls -A logs/ 2>/dev/null)" ]; then
20-
echo "Syncing logs to S3..."
23+
echo "Syncing codeclash logs to S3..."
2124
aws s3 sync logs/ s3://codeclash/logs/ || echo "Warning: Failed to sync logs to S3"
2225
else
23-
echo "No logs to sync"
26+
echo "No codeclashlogs to sync"
2427
fi
28+
echo "docker ps:"
29+
docker ps
30+
echo "docker stats:"
31+
docker stats --no-stream
2532
echo "Docker space usage:"
2633
docker system df
34+
echo "--------------------------------"
35+
echo "Last 100 lines of Docker logs"
36+
docker ps -aq | xargs -I {} sh -c 'logs=$(docker logs --tail 100 {} 2>&1); [ -n "$logs" ] && echo "=== {} ===" && echo "$logs"'Retry
37+
echo "--------------------------------"
2738
echo "Docker cleanup"
2839
docker system prune -af
2940
echo "Docker space usage:"

0 commit comments

Comments
 (0)