system-config/modules/jenkins_jobs/manifests/build_job.pp
Andrew Hutchings 04bf54ac40 Make Jenkins Jobs more modular
Each job has a manifest in the jenkins_jobs/manifests/jobs directory
Jobs are grouped in python_jobs and generic_jobs
The job groups or individual jobs can be added to a site manifest

Also fixes bad XML output, python27 job and bug 987428

Change-Id: I1ebc889cee08b080deb6ba46aee69ab2ae0bb6b6
2012-04-24 15:19:59 +01:00

37 lines
1023 B
Puppet

define jenkins_jobs::build_job($site, $project, $job, $node_group, $triggers="", $builders, $publishers="", $logrotate="", $scm="", $trigger_branches="") {
file { "/var/lib/jenkins/jobs/${name}":
ensure => directory,
owner => 'jenkins',
}
file { "/var/lib/jenkins/jobs/${name}/builds":
ensure => directory,
owner => 'jenkins',
require => File["/var/lib/jenkins/jobs/${name}"]
}
file { "/var/lib/jenkins/jobs/${name}/config-history":
ensure => directory,
owner => 'jenkins',
require => File["/var/lib/jenkins/jobs/${name}"]
}
file { "/var/lib/jenkins/jobs/${name}/config.xml":
ensure => present,
content => template("jenkins_jobs/body.xml.erb"),
owner => 'jenkins',
require => File["/var/lib/jenkins/jobs/${name}"],
notify => Exec["jenkins"]
}
file { "/var/lib/jenkins/jobs/${name}/nextBuildNumber":
ensure => present,
content => "1",
owner => 'jenkins',
replace => false,
require => File["/var/lib/jenkins/jobs/${name}"]
}
}