jenkinsfile - watch screen test adding kill subroutine init

This commit is contained in:
matt committed 2026-10-18 03:13:08 -07:00
1 parent 1a8dea0cdc
commit 6e32e99d83
1 file changed
+18
+18
View File
@@ -78,6 +78,24 @@ pipeline {
}
}
stage('Log Tail Termination Subroutine'){
steps {
sshagent([env.SSH_CREDENTIALS_ID]) {
sh """
ssh -o StrictHostKeyChecking=no root@${params.host_ip} -o ServerAliveInterval=60 -o ServerAliveCountMax=120 << EOF
(
while pgrep -f "tail.*ble_test_${env.TEST_HASH}" > /dev/null; do
if ! screen -list | grep -q ble_test_${env.TEST_HASH}; then
pkill -9 -f "tail.*ble_test_${env.TEST_HASH}"
fi
sleep 5
done
) &
"""
}
}
}
//while screen -list | grep -q ble_test_${env.TEST_HASH}; do
// tail -f /tmp/ble_test_${env.TEST_HASH}.log
//done