1

I am trying to find a way to kill a Jenkins job and all its children immediately. Is there a such a way to do this in Jenkins?

Initially I was looking at finding a process group and killing it:

kill -TERM -- -....

But ps is not returning anything Jenkins related.

1) Is there a way to kill a job and its children in Jenkins and

2) If yes, is it possible to create a job that can take another job as a parameter to kill it?

Mark Setchell
  • 191,897
  • 31
  • 273
  • 432
Anton Kim
  • 879
  • 13
  • 36

1 Answers1

1

You could consider stopping a build in Jenkins via the REST api

http://<Jenkins_URL>/job/<Job_Name>/<Build_Number>/stop

That should stop the right process, and its children.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250