Skip to content

Commit

Permalink
Add class to allow use of Jenkins from the command line
Browse files Browse the repository at this point in the history
  • Loading branch information
jchristi committed Oct 9, 2013
1 parent 956a1be commit cfb33ef
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions manifests/cli.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Class: jenkins::cli
#
# Allow Jenkins commands to be issued from the command line
#
class jenkins::cli {

$jar = '/usr/lib/jenkins/jenkins-cli.jar'
$extract_jar = 'jar -xf /usr/lib/jenkins/jenkins.war WEB-INF/jenkins-cli.jar'
$move_jar = "mv WEB-INF/jenkins-cli.jar $jar"
$remove_dir = 'rm -rf WEB-INF'

exec { 'jenkins-cli':
command => "$extract_jar && $move_jar && $remove_dir",
path => ['/bin', '/usr/bin'],
cwd => '/root',
creates => $jar,
require => Package['jenkins'],
}

}

0 comments on commit cfb33ef

Please sign in to comment.