1.Set timeout condition for Jenkins Pipeline timeout --> timeoutPipeline.groovy
2.Set timeout condition for particuar stage of pipeline
--> timoutStageinPipelinewithAbort.txt
3.Set timeout for particualr stage of pipeline but skip that stage only --> timeoutStageInPipelinewithoutAbort.txt
**options{ timeout(time: 1,unit:'MINUTES') } **
After one minute complete pipeline will stop
2.Set timeout condition for particuar stage of pipeline --> timoutStageinPipelinewithAbort.txt
Since in the first stage, we face timout even before the stage could get completed, In stage add.
options {
timeout(time: 1, unit: 'HOURS')
}
3.Set timeout for particualr stage of pipeline but skip that stage only --> timeoutStageInPipelinewithoutAbort.txt
Inside the steps add
** timeout(time: 4, unit: 'MINUTES'){
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
echo 'Hello World'
sleep 300
}
}
**