I have a script placed in the linux
box with name test.py. I have triggered this script using Jenkins and the job is running successfully.
My query here is if i have to stop the script execution, how can i sent the signal to the script to stop from Jenkins itself? I tried stopping the job but that didnt stop the script execution.
Manually from the linux box, I have used the try
and except KeyboardInterrupt
and it's working. How can i do the same way from the Jenkins. Do i have to add any code to capture this when i stop the Jenkins job. Please clarify.
Sample script -
#!/app/code/Python/bin/python3
import time
for t in range(0, 500):
print ("hi")
time.sleep(5)