Hello Guys,
This is one tricky question, Please review the problem statement and advise me how to get into further.
I have pipeline code which is combined of groovy and sh script. Refer the below sample one, based on that the line 4 code should be execute once ssh commend done in the target server completely which meant the triggered shell script takes time to complete in target server, so its depends on load in the script, by that we cannot put static sleep time after the line 3. what is the best way to achieve that.
node{
line 1 code
line 2 code
sh "ssh <usercredential>@<serverIP>: sh abc.sh or scb // line 3
line 4 code
}