I have a list of freestyle jobs which should be built by pipeline script. In case the job finishes with failed status, I catch exception. What is the best way to limit job execution in time, namely if job execution exceeds some time limit, stop execution of a job and build the next one within the listofUniqueJobsToExecute?
Here is part of my pipeline script:
listofUniqueJobsToExecute = ['job1', 'job2', 'job3']
node {
for(job in listofUniqueJobsToExecute) {
try {
build job: job
}
catch (e) {
slackSend channel: ...
throw e
}
}