jenkinsfile - watch screen test 7g new ssh method

This commit is contained in:
matt committed 2026-10-18 02:11:04 -07:00
1 parent 0496eb4076
commit 5bef63f69a
1 file changed
+19 -18
+19 -18
View File
@@ -80,25 +80,26 @@ pipeline {
//while screen -list | grep -q ble_test_${env.TEST_HASH}; do //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
//done stage('View Test Logs') { //done
steps { stage('View Test Logs'){
sshagent([env.SSH_CREDENTIALS_ID]) { steps {
sh """ sshagent([env.SSH_CREDENTIALS_ID]) {
#!/usr/bin/env bash sh """
ssh -o StrictHostKeyChecking=no root@${params.host_ip} << EOF #!/usr/bin/env bash
set -euo pipefail ssh -o StrictHostKeyChecking=no root@${params.host_ip} << EOF
# Loop while the screen session exists set -euo pipefail
while screen -list | grep -q "ble_test_${TEST_HASH}"; do # Loop while the screen session exists
# Tail the file and flush each line immediately while screen -list | grep -q "ble_test_${TEST_HASH}"; do
tail -n +1 -f "/tmp/ble_test_${env.TEST_HASH}.log" | while IFS= read -r line; do # Tail the file and flush each line immediately
echo "$line" tail -n +1 -f "/tmp/ble_test_${env.TEST_HASH}.log" | while IFS= read -r line; do
done echo "$line"
done done
EOF done
""" EOF
"""
}
}
} }
}
}
} }