Skip to content

Commit

Permalink
Add no_proxy configuration.
Browse files Browse the repository at this point in the history
  • Loading branch information
feathr1 authored and ricfeatherstone committed May 26, 2015
1 parent 2343dc1 commit 843495d
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
6 changes: 5 additions & 1 deletion manifests/plugin.pp
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,14 @@

if (empty(grep([ $::jenkins_plugins ], $search))) {
if ($jenkins::proxy_host) {
unless empty($jenkins::no_proxy_list) {
$no_proxy = join($jenkins::no_proxy_list, ',')
}
Exec {
environment => [
"http_proxy=${jenkins::proxy_host}:${jenkins::proxy_port}",
"https_proxy=${jenkins::proxy_host}:${jenkins::proxy_port}"
"https_proxy=${jenkins::proxy_host}:${jenkins::proxy_port}",
"no_proxy=${no_proxy}"
]
}
}
Expand Down
35 changes: 35 additions & 0 deletions spec/defines/jenkins_plugin_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,45 @@
]}

it do
should contain_exec('create-pinnedfile-myplug').with(
:environment => [
"http_proxy=proxy.company.com:8080",
"https_proxy=proxy.company.com:8080",
"no_proxy="
]
)
should contain_exec('download-myplug').with(
:environment => [
"http_proxy=proxy.company.com:8080",
"https_proxy=proxy.company.com:8080",
"no_proxy="
]
)
end
end

describe 'with proxy and no proxy' do
let(:pre_condition) { [
'class jenkins {
$proxy_host = "proxy.company.com"
$proxy_port = 8080
$no_proxy_list = ["noproxy.company.com", "also-noproxy.com"]
}',
'include jenkins'
]}
it do
should contain_exec('create-pinnedfile-myplug').with(
:environment => [
"http_proxy=proxy.company.com:8080",
"https_proxy=proxy.company.com:8080",
"no_proxy=noproxy.company.com,also-noproxy.com"
]
)
should contain_exec('download-myplug').with(
:environment => [
"http_proxy=proxy.company.com:8080",
"https_proxy=proxy.company.com:8080",
"no_proxy=noproxy.company.com,also-noproxy.com"
]
)
end
Expand Down

0 comments on commit 843495d

Please sign in to comment.