From 1c01c6339f0f4cde210343ea2e08ab9790c5cde8 Mon Sep 17 00:00:00 2001 From: matt Date: Sun, 18 Oct 2026 01:44:18 -0700 Subject: [PATCH] jenkinsfile - watch screen test 6 intern suggestion --- api/Jenkinsfile.ble_test | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/api/Jenkinsfile.ble_test b/api/Jenkinsfile.ble_test index 6bf7d3b..fcb2046 100644 --- a/api/Jenkinsfile.ble_test +++ b/api/Jenkinsfile.ble_test @@ -72,10 +72,29 @@ pipeline { git pull cd /opt/ble-test/ble_api/api screen -dmS ble_test_${env.TEST_HASH} bash -c "cd /opt/ble-test/ble_api/api && python3 -u ./ble.py ${params.test_count} | tee /tmp/ble_test_${env.TEST_HASH}.log" - sleep 2 + + """ + } + } + } + // 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 + tail -f /tmp/ble_test_${env.TEST_HASH}.log | + while IFS= read -r line; do + echo "$line" + if ! screen -list | grep -q ble_test_${env.TEST_HASH}; then + break 2 + fi + done done + """ } }