Skip to content
This repository was archived by the owner on Mar 3, 2023. It is now read-only.

Commit 6c7793b

Browse files
add test and validate string
1 parent 0be990b commit 6c7793b

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

manifests/init.pp

+2-1
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@
239239
# @param default_plugins_host
240240
# Provide a way to override plugins host for all plugins
241241
#
242-
# https://issues.jenkins-ci.org/browse/INFRA-1060
242+
# https://issues.jenkins-ci.org/browse/INFRA-1060
243243
#
244244
# @example Manage version of ``credentials`` plugin (hiera)
245245
# jenkins::default_plugins: []
@@ -351,6 +351,7 @@
351351
validate_string($user)
352352
validate_bool($manage_group)
353353
validate_string($group)
354+
validate_string($default_plugins_host)
354355
validate_bool($purge_plugins)
355356
if $purge_plugins and ! $manage_datadirs {
356357
warning('jenkins::purge_plugins has no effect unless jenkins::manage_datadirs is true')

spec/defines/jenkins_plugin_spec.rb

+17
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,23 @@ class { jenkins:
145145
end
146146
end
147147

148+
describe 'with custom default_plugins_host' do
149+
let(:pre_condition) do
150+
<<-EOS
151+
class { jenkins:
152+
default_plugins_host => "https://update.jenkins.custom",
153+
}
154+
EOS
155+
end
156+
157+
it do
158+
should contain_archive('myplug.hpi').with(
159+
:source => 'https://update.jenkins.custom/latest/myplug.hpi',
160+
)
161+
end
162+
end
163+
164+
148165
describe 'with a custom update center' do
149166
shared_examples 'execute the right fetch command' do
150167
it 'should retrieve the plugin' do

0 commit comments

Comments
 (0)