summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFathi Boudra <fathi.boudra@linaro.org>2015-04-30 15:13:42 +0300
committerFathi Boudra <fathi.boudra@linaro.org>2015-04-30 15:13:42 +0300
commit6f8a47cd45c1446b28d3a8778610c065d825f7ba (patch)
treee84452389c0980678d89293bc88798d93840081b
parentae093fbb98dcb49dbb3c5f30d0ce74ee7ed1c43f (diff)
post-build-lava.groovy: get lava server from the submitted job
some build jobs don't set LAVA_SERVER. Rely on a more deterministic approach: get it from the submitted job Signed-off-by: Fathi Boudra <fathi.boudra@linaro.org>
-rw-r--r--post-build-lava.groovy5
1 files changed, 4 insertions, 1 deletions
diff --git a/post-build-lava.groovy b/post-build-lava.groovy
index 73b9d97..d5ee237 100644
--- a/post-build-lava.groovy
+++ b/post-build-lava.groovy
@@ -4,7 +4,10 @@ import hudson.model.*
def matcher = manager.getLogMatcher(".*LAVA Job Id.*")
if (matcher?.matches()) {
def lavaJobId = matcher.group(0).split(",")[0].substring(13)
- def lavaServer = manager.build.buildVariables.get("LAVA_SERVER").split("/")[0]
+ def serverMatcher = manager.getLogMatcher(".*\"server\":.*")
+ if (serverMatcher.matches()) {
+ def lavaServer = serverMatcher.group(0).split("://")[1].split("/")[0]
+ }
def lavaJobUrl = "http://${lavaServer}/scheduler/job/${lavaJobId}"
def lavaDescription = "&nbsp;LAVA Job Id: <a href='${lavaJobUrl}'>${lavaJobId}</a>"