/*
 * DSL script to create some support jobs
 */

/*
 * Definition of jobs
 */

pipelineJob('FwSupportTools-checkoutOnly') {
	description '''<p>This job keeps the <i>FwSupportTools</i> directory up-to-date on the packaging agents.</p>
<p>The job is created by the DSL plugin from <i>Support-jobs.groovy</i> script.<p>'''

	triggers {
		gerrit {
			project('FwSupportTools', 'develop')
			events {
				refUpdated()
			}
		}
	}

	definition {
		cpsScm {
			scm {
				github('sillsdev/FwSupportTools', 'develop')
			}
			scriptPath('Jenkinsfile')
		}
	}
}

pipelineJob('ci-builder-scripts-checkoutOnly') {
	description '''<p>This job keeps the <i>ci-builder-scripts</i> directory up-to-date on the packaging agents.</p>
<p>The job is created by the DSL plugin from <i>Support-jobs.groovy</i> script.<p>'''

	triggers {
		gerrit {
			project('ci-builder-scripts', 'master')
			events {
				refUpdated()
			}
		}
	}

	definition {
		cpsScm {
			scm {
				github('sillsdev/ci-builder-scripts', 'master')
			}
			scriptPath('Jenkinsfile')
		}
	}
}

/*
 * DSL script to create some support jobs
 */

/*
 * Definition of jobs
 */

for (job in [
	[name: 'FwSupportTools', branch: 'develop'],
	[name: 'ci-builder-scripts', branch: 'master']])
{
	pipelineJob("${job.name}-checkoutOnly") {
		description """<p>This job keeps the <i>${job.name}</i> directory up-to-date on the packaging agents.</p>
<p>The job is created by the DSL plugin from <i>Support-jobs.groovy</i> script.<p>"""

		quietPeriod(120 /*seconds*/)

		triggers {
			gerrit {
				project(job.name, job.branch)
				events {
					refUpdated()
				}
			}
		}

		definition {
			cpsScm {
				scm {
					github("sillsdev/${job.name}", job.branch)
				}
				scriptPath('Jenkinsfile')
			}
		}
	}
}

Add quiet period to support-jobs
Add quiet period to support-jobs

We have to wait a certain time so that the jobs get synced to
GitHub before we try to checkout on the agents.

Change-Id: If6781f2fea36cc21eb1fdf690dc556df0091e77e
