Skip to content

Commit

Permalink
update jenkins-cli fetch to use Jenkins URL
Browse files Browse the repository at this point in the history
  • Loading branch information
avbm committed May 5, 2020
1 parent 15b7446 commit 8f979e1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 24 deletions.
6 changes: 3 additions & 3 deletions manifests/cli.pp
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
}

$jar = "${jenkins::libdir}/jenkins-cli.jar"
$extract_jar = "jar -xf ${jenkins::libdir}/jenkins.war WEB-INF/jenkins-cli.jar"
$move_jar = "mv WEB-INF/jenkins-cli.jar ${jar}"
$download_jar = "wget http://localhost:${jenkins::port}/jnlpJars/jenkins-cli.jar -O ${jar}.downloading"
$move_jar = "mv ${jar}.downloading ${jar}"
$remove_dir = 'rm -rf WEB-INF'
$cli_tries = $jenkins::cli_tries
$cli_try_sleep = $jenkins::cli_try_sleep
Expand All @@ -36,7 +36,7 @@
creates => $jar,
}
~> exec { 'jenkins-cli' :
command => "${extract_jar} && ${move_jar} && ${remove_dir}",
command => "${download_jar} && ${move_jar}",
path => ['/bin', '/usr/bin'],
cwd => '/tmp',
refreshonly => true,
Expand Down
21 changes: 0 additions & 21 deletions spec/classes/jenkins_cli_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
it { is_expected.to contain_exec('safe-restart-jenkins').with('environment' => nil) }
it { is_expected.to contain_jenkins__sysconfig('HTTP_PORT').with_value('9000') }

<<<<<<< HEAD
describe 'jenkins::cli' do
describe 'relationships' do
it do
Expand All @@ -40,26 +39,6 @@
that_comes_before('Anchor[jenkins::end]')
end
end
=======
context '$cli => true' do
let(:params) {{ :cli => true,
:cli_ssh_keyfile => '/path/to/key',
:config_hash => { 'HTTP_PORT' => { 'value' => '9000' } }}
}
it { should contain_class('jenkins::cli') }
it { should contain_exec('jenkins-cli') }
it { should contain_exec('reload-jenkins').with_command(/http:\/\/localhost:9000/) }
it { should contain_exec('reload-jenkins').with_command(/-i\s'\/path\/to\/key'/) }
it { should contain_exec('safe-restart-jenkins') }
it { should contain_exec('safe-restart-jenkins').with('environment' => nil) }
it { should contain_jenkins__sysconfig('HTTP_PORT').with_value('9000') }

describe 'jenkins::cli' do
describe 'relationships' do
it do
should contain_class('jenkins::cli').
that_requires('Class[jenkins::service]')
>>>>>>> 14d095a... CIP-389 Resolve credential leak via ps with cli
end

context '$cli_password is defined' do
Expand Down

0 comments on commit 8f979e1

Please sign in to comment.