From 55cd88d9dc00586761360930f57931f52cd4d75a Mon Sep 17 00:00:00 2001 From: matt Date: Sun, 18 Oct 2026 02:04:45 -0700 Subject: [PATCH] jenkinsfile - watch screen test 7c new ssh method --- api/Jenkinsfile.ble_test | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/api/Jenkinsfile.ble_test b/api/Jenkinsfile.ble_test index 3e99051..49dba09 100644 --- a/api/Jenkinsfile.ble_test +++ b/api/Jenkinsfile.ble_test @@ -84,18 +84,30 @@ pipeline { 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 - + sh '''#!/usr/bin/env bash + ssh -o StrictHostKeyChecking=no root@${params.host_ip} << 'EOF' set -euo pipefail - # Outer loop - runs as long as the screen session is alive + # Loop while the screen session exists 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" + # Tail the file and flush each line immediately + tail -n +1 -f "/tmp/ble_test_${env.TEST_HASH}.log" | while IFS= read -r line; do + echo "$line" done done - """ + EOF + ''' + + //sh """ + //ssh -o StrictHostKeyChecking=no root@${params.host_ip} -o ServerAliveInterval=60 -o ServerAliveCountMax=120 << EOF + // 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 + //""" } } }