diff --git a/plugins/jenkins/jenkins_ b/plugins/jenkins/jenkins_ index 2b9c91a0..31b759c6 100755 --- a/plugins/jenkins/jenkins_ +++ b/plugins/jenkins/jenkins_ @@ -23,11 +23,11 @@ You can set the modes with naming the softlink: This plugin is configurable environment variables. -env.url Jenkins Host -env.port Jenkins Port -env.context Jenkins Context path -env.user User for the API Tokent -env.apiToken Jenkins API Token (see https://wiki.jenkins-ci.org/display/JENKINS/Authenticating+scripted+clients) +env.url Jenkins Host +env.port Jenkins Port +env.context Jenkins Context path +env.user User for the API Tokent +env.apiToken Jenkins API Token (see https://wiki.jenkins-ci.org/display/JENKINS/Authenticating+scripted+clients) env.jobDepth How far into job "folders" should the plugin check for jobs Example: @@ -82,51 +82,51 @@ my %states = ( 'aborted'=>'failing', 'aborted_anime'=>'failing' ); -my $auth = ( $user ne "" and $apiToken ne "" ? " --auth-no-challenge --user=$user --password=$apiToken" : "" ); +my $auth = ( $user ne "" and $apiToken ne "" ? " --auth-no-challenge --user=$user --password=$apiToken" : "" ); if ( exists $ARGV[0] and $ARGV[0] eq "config" ) { if( $type eq "results" ) { - print "graph_args --base 1000 -l 0\n"; - print "graph_title Jenkins Build Results\n"; - print "graph_vlabel Build Results\n"; - print "graph_category devel\n"; - print "graph_info The Graph shows the Status of each Build\n"; - print "build_disabled.draw AREA\n"; - print "build_disabled.label disabled\n"; - print "build_disabled.type GAUGE\n"; - print "build_disabled.colour 8A8A8A\n"; - print "build_failing.draw STACK\n"; - print "build_failing.label failing\n"; - print "build_failing.type GAUGE\n"; - print "build_failing.colour E61217\n"; - print "build_unstable.draw STACK\n"; - print "build_unstable.label unstable\n"; - print "build_unstable.type GAUGE\n"; - print "build_unstable.colour F3E438\n"; - print "build_stable.draw STACK\n"; - print "build_stable.label stable\n"; - print "build_stable.type GAUGE\n"; - print "build_stable.colour 294D99\n"; - exit; + print "graph_args --base 1000 -l 0\n"; + print "graph_title Jenkins Build Results\n"; + print "graph_vlabel Build Results\n"; + print "graph_category devel\n"; + print "graph_info The Graph shows the Status of each Build\n"; + print "build_disabled.draw AREA\n"; + print "build_disabled.label disabled\n"; + print "build_disabled.type GAUGE\n"; + print "build_disabled.colour 8A8A8A\n"; + print "build_failing.draw STACK\n"; + print "build_failing.label failing\n"; + print "build_failing.type GAUGE\n"; + print "build_failing.colour E61217\n"; + print "build_unstable.draw STACK\n"; + print "build_unstable.label unstable\n"; + print "build_unstable.type GAUGE\n"; + print "build_unstable.colour F3E438\n"; + print "build_stable.draw STACK\n"; + print "build_stable.label stable\n"; + print "build_stable.type GAUGE\n"; + print "build_stable.colour 294D99\n"; + exit; } if( $type eq "queue" ) { print "graph_args --base 1000 -l 0\n"; - print "graph_title Jenkins Queue Length\n"; - print "graph_vlabel Number of Jobs in Queue\n"; - print "graph_category devel\n"; - print "graph_info The Graph shows the Number of Jobs in the Build Queue\n"; - print "build_count.label Jobs in Queue\n"; - print "build_count.type GAUGE\n"; + print "graph_title Jenkins Queue Length\n"; + print "graph_vlabel Number of Jobs in Queue\n"; + print "graph_category devel\n"; + print "graph_info The Graph shows the Number of Jobs in the Build Queue\n"; + print "build_count.label Jobs in Queue\n"; + print "build_count.type GAUGE\n"; exit; } if( $type eq "running" ) { print "graph_args --base 1000 -l 0\n"; - print "graph_title Jenkins Builds Running\n"; - print "graph_vlabel Builds currently running\n"; - print "graph_category devel\n"; - print "graph_info The Graph shows the Number of Builds, currently running\n"; - print "build_running.label running Builds\n"; - print "build_running.type GAUGE\n"; + print "graph_title Jenkins Builds Running\n"; + print "graph_vlabel Builds currently running\n"; + print "graph_category devel\n"; + print "graph_info The Graph shows the Number of Builds, currently running\n"; + print "build_running.label running Builds\n"; + print "build_running.type GAUGE\n"; exit; } } else { @@ -136,7 +136,7 @@ if ( exists $ARGV[0] and $ARGV[0] eq "config" ) { for (2..$jobDepth) { $tree = "jobs[name,color,$tree]"; } - + if( $type eq "results" ) { my $result = `$cmd'/api/json?depth=$jobDepth&tree=$tree'`; my $parsed = decode_json($result); @@ -153,7 +153,7 @@ if ( exists $ARGV[0] and $ARGV[0] eq "config" ) { my $parsed = decode_json($result); my $count = parse_running_builds($parsed->{'jobs'}); print "build_running.value ", $count, "\n"; - exit; + exit; } if( $type eq "queue" ) {