chore(ci): add heartbeat logs during flutter apk build

Print a timestamp every 30 seconds while flutter build runs so long
Gradle/download phases are visible in Jenkins instead of appearing hung.

Made-with: Cursor
This commit is contained in:
YuanXuan 2026-03-24 10:49:25 +08:00
parent f072df7b76
commit 9fbefc4438
1 changed files with 8 additions and 1 deletions

9
Jenkinsfile vendored
View File

@ -158,7 +158,14 @@ pipeline {
EXTRA_ARGS="\$EXTRA_ARGS --dart-define=APP_ENV=\$BUILD_ENV" EXTRA_ARGS="\$EXTRA_ARGS --dart-define=APP_ENV=\$BUILD_ENV"
echo " - 开始构建 APK 参数: \$EXTRA_ARGS" echo " - 开始构建 APK 参数: \$EXTRA_ARGS"
fvm flutter build apk --release \$EXTRA_ARGS echo " - 开始执行 flutter build apk构建期间每30秒输出一次心跳..."
(fvm flutter build apk --release \$EXTRA_ARGS) &
BUILD_PID=\$!
while kill -0 \$BUILD_PID 2>/dev/null; do
echo " - 构建仍在进行中... \$(date '+%H:%M:%S')"
sleep 30
done
wait \$BUILD_PID
""" """
echo " ✅ ${currentApp} Android APK 构建完成" echo " ✅ ${currentApp} Android APK 构建完成"
} }