From 70efc96b11a37f0c617ca2eddb2e62d08795f479 Mon Sep 17 00:00:00 2001 From: Masahiro Fujiwara Date: Tue, 17 Jan 2017 06:36:48 +0900 Subject: [PATCH] =?UTF-8?q?Take=20=E2=80=99/job=E2=80=99=20prefix=20out=20?= =?UTF-8?q?only=20if=20=E2=80=98/=E2=80=98=20appears.=20For=20backward=20c?= =?UTF-8?q?ompatibility.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/server.js b/server.js index 443a0e2..1096a82 100644 --- a/server.js +++ b/server.js @@ -3859,6 +3859,9 @@ cache(function(data, match, sendBadge, request) { json: true, uri: scheme + '://' + host + '/job/' + job + '/api/json?tree=color' }; + if( job.indexOf('/') > -1 ) { + options.uri = scheme + '://' + host + '/' + job + '/api/json?tree=color'; + } if (serverSecrets && serverSecrets.jenkins_user) { options.auth = { @@ -3913,6 +3916,10 @@ cache(function(data, match, sendBadge, request) { uri: scheme + '://' + host + '/job/' + job + '/lastBuild/api/json?tree=actions[failCount,skipCount,totalCount]' }; + if( job.indexOf('/') > -1 ) { + options.uri = scheme + '://' + host + '/' + job + + '/lastBuild/api/json?tree=actions[failCount,skipCount,totalCount]'; + } if (serverSecrets && serverSecrets.jenkins_user) { options.auth = { @@ -3969,6 +3976,10 @@ cache(function(data, match, sendBadge, request) { uri: scheme + '://' + host + '/job/' + job + '/lastBuild/cobertura/api/json?tree=results[elements[name,denominator,numerator,ratio]]' }; + if( job.indexOf('/') > -1 ) { + options.uri = scheme + '://' + host + '/' + job + + '/lastBuild/cobertura/api/json?tree=results[elements[name,denominator,numerator,ratio]]'; + } if (serverSecrets && serverSecrets.jenkins_user) { options.auth = {