jenkinsfile - watch screen test intern refinement on kill loop
This commit is contained in:
1 parent
3c8ebbcce5
commit
6fd0cdeee6
1 file changed
+15
-13
+15
-13
@@ -80,20 +80,22 @@ pipeline {
|
|||||||
|
|
||||||
stage('Log Tail Termination Subroutine'){
|
stage('Log Tail Termination Subroutine'){
|
||||||
steps {
|
steps {
|
||||||
sshagent([env.SSH_CREDENTIALS_ID]) {
|
sshagent([env.SSH_CREDENTIALS_ID]) {
|
||||||
sh """
|
sh """
|
||||||
ssh -o StrictHostKeyChecking=no root@${params.host_ip} -o ServerAliveInterval=60 -o ServerAliveCountMax=120 << EOF
|
ssh -o StrictHostKeyChecking=no root@${params.host_ip} \
|
||||||
echo Running background termination loop I hope...
|
-o ServerAliveInterval=60 -o ServerAliveCountMax=120 \
|
||||||
(
|
<< 'EOF'
|
||||||
sleep 10
|
echo Running background termination loop I hope...
|
||||||
while pgrep -f "tail.*ble_test_${env.TEST_HASH}" > /dev/null; do
|
nohup sh -c '
|
||||||
if ! screen -list | grep -q ble_test_${env.TEST_HASH}; then
|
sleep 10
|
||||||
pkill -9 -f "tail.*ble_test_${env.TEST_HASH}"
|
while pgrep -f "tail.*ble_test_${env.TEST_HASH}" > /dev/null; do
|
||||||
fi
|
if ! screen -list | grep -q ble_test_${env.TEST_HASH}; then
|
||||||
echo Hello from in the loop
|
pkill -9 -f "tail.*ble_test_${env.TEST_HASH}"
|
||||||
sleep 5
|
fi
|
||||||
done
|
sleep 5
|
||||||
) &
|
done
|
||||||
|
' &
|
||||||
|
EOF
|
||||||
"""
|
"""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user