Add the ability to set your own plugin url
Using your own url is an equivalent to Manage Jenkins -> Manage Plugins -> Advanced -> Upload Plugin option. Change-Id: Iac6d2cd1b679443f631bf174e5d3322d7574687a
This commit is contained in:
parent
3501262d49
commit
62c2056266
@ -20,6 +20,7 @@
|
||||
define jenkins::plugin(
|
||||
$version='latest',
|
||||
$pin=false,
|
||||
$plugin_url=undef,
|
||||
) {
|
||||
$plugin = "${name}.hpi"
|
||||
$plugin_dir = '/var/lib/jenkins/plugins'
|
||||
@ -31,6 +32,12 @@ define jenkins::plugin(
|
||||
$base_url = "http://updates.jenkins-ci.org/download/plugins/${name}/${version}"
|
||||
}
|
||||
|
||||
if $plugin_url == undef {
|
||||
$_plugin_url = "${base_url}/${plugin}"
|
||||
} else {
|
||||
$_plugin_url = $plugin_url
|
||||
}
|
||||
|
||||
if (!defined(File[$plugin_dir])) {
|
||||
file {
|
||||
[
|
||||
@ -57,7 +64,7 @@ define jenkins::plugin(
|
||||
}
|
||||
|
||||
exec { "download-${name}" :
|
||||
command => "wget --no-check-certificate ${base_url}/${plugin}",
|
||||
command => "wget --no-check-certificate ${_plugin_url}",
|
||||
cwd => $plugin_dir,
|
||||
require => File[$plugin_dir],
|
||||
path => ['/usr/bin', '/usr/sbin',],
|
||||
|
Loading…
x
Reference in New Issue
Block a user