pipeline {
agent none
stages {
stage('Build') {
steps {
echo 'Triggering test cases..'
build job: 'TestIt', wait: false
}
}
stage('Waiting for something') {
steps {
echo 'Waiting to collect logs'
sleep time: 1, unit: 'MINUTES'
}
}
stage('Collect Logs') {
steps {
echo 'Collecting the logs'
build 'CollectLogs'
}
}
}
post {
success {
echo "All done"
}
failure {
echo "Something failed"
}
}
}build 'TestIt'sleep time: 1, unit: 'HOURS'If my First job runs for 10 hours,
My second job needs to be run for every 1 hour to just collect the logs. Means second job should be triggered 10 times.