I am trying to build a pipeline where i would need to chain multiple jobs and some of them has to start at a certain time.
Ex: Job1(starts at Midnight) -> Job2 -> Job3 ->Job4(starts at 4 PM)
Using Declarative Syntax:
pipeline {
agent any
stages{
stage('Fetch Latest Code-1') {
steps{
build job: 'Get Latest - All Nodes', quietPeriod: 60
}
}
stage('CI Day - 1') {
parallel {
stage('ANZ CI'){
steps{
build job: 'ANZ - CI', quietPeriod: 120
}
}
stage('BRZ CI'){
steps{
build job: 'BRZ_CI', quietPeriod: 120
}
}
stage('NAM CI'){
steps{
build job: 'NAM - CI', quietPeriod: 120
}
}
}
}
stage('BEP Part 2') {
steps{
build job: 'BEP_CI_Verification_Job', quietPeriod: 180
}
}
stage('Intermediate Results') {
steps{
build job: 'CI Automation Results', parameters: [string(name: 'Files', value: '_CI_')], quietPeriod: 300
}
}
}
}
As I create this job, I had configured the Job to start at 12 Midnight. Therefore, the 1st job automatically gets started at midnight.
But, I would also need the second job(CI Day - 1) to begin at 1 AM & the last Job 'Intermediate results' to start at 6 PM.
As these jobs are Multi-Configuration Jobs(already tried setting them individually at the desired timings but they get overwritten when called through pipeline).
Also, did try triggers{ cron(0 1 * * 6) } within the stage/steps. No luck!