system-config/modules/jenkins_jobs/manifests/build_job.pp
Andrew Hutchings e5b3600b5c Jenkins Jobs bug fixes
* Add auth_build internal option and set to true for gates (fixes bug #989148)
* Add upload_project option to tarball job and set to project by default (fixes bug #989855)
* Add support for ensure => disabled and ensure => absent (fixes bug #988319)

Change-Id: Id61deb4b50df70f38c18e7e9d2e8d6510805e11c
2012-05-02 15:07:59 +01:00

51 lines
1.4 KiB
Puppet

define jenkins_jobs::build_job($site, $project, $job, $node_group, $triggers="", $builders, $publishers="", $logrotate="", $scm="", $trigger_branches="", $auth_build=false, $upload_project="", $ensure="present") {
if $ensure == "absent" {
file { "/var/lib/jenkins/jobs/${name}":
ensure => purged,
owner => 'jenkins',
recurse => true,
notify => Exec['jenkins']
}
} else {
if $ensure == "disabled" {
$disabled = true
} else {
$disabled = false
}
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}"]
}
}
}