jenkinsfile - watch screen test 7 intern again

This commit is contained in:
matt committed 2026-10-18 01:55:01 -07:00
1 parent 56fb87ab5e
commit be37ad49cb
1 file changed
+12 -4
+12 -4
View File
@@ -78,15 +78,23 @@ pipeline {
}
}
//while screen -list | grep -q ble_test_${env.TEST_HASH}; do
// tail -f /tmp/ble_test_${env.TEST_HASH}.log
//done
stage('View Test Logs'){
steps {
sshagent([env.SSH_CREDENTIALS_ID]) {
sh """
ssh -o StrictHostKeyChecking=no root@${params.host_ip} -o ServerAliveInterval=60 -o ServerAliveCountMax=120 << EOF
while screen -list | grep -q ble_test_${env.TEST_HASH}; do
tail -f /tmp/ble_test_${env.TEST_HASH}.log
done
set -euo pipefail
# Outer loop - runs as long as the screen session is alive
while screen -list | grep -q "ble_test_${TEST_HASH}"; do
# `tail -f` streams the file; the read-loop ensures line-by-line flush
tail -n +1 -f /tmp/ble_test_${env.TEST_HASH}.log | while IFS= read -r line; do
echo "\$line"
done
done
"""
}
}
@@ -94,7 +102,7 @@ pipeline {
}
// ---------------------------------------------------------------------
// Post‑build cleanup - kill the remote screen session
// Post-build cleanup - kill the remote screen session
// ---------------------------------------------------------------------
post {
always {