summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFathi Boudra <fathi.boudra@linaro.org>2015-04-30 12:57:03 +0300
committerFathi Boudra <fathi.boudra@linaro.org>2015-04-30 12:57:03 +0300
commitae093fbb98dcb49dbb3c5f30d0ce74ee7ed1c43f (patch)
tree47f822fe3576e30743f6624f899f78540aab6800
parent9afc03938e4883e2321a4f4e576ffc4f243e391f (diff)
post-build-lava.groovy: fix indentation (4 space)
Signed-off-by: Fathi Boudra <fathi.boudra@linaro.org>
-rw-r--r--post-build-lava.groovy96
1 files changed, 48 insertions, 48 deletions
diff --git a/post-build-lava.groovy b/post-build-lava.groovy
index 8e7d125..73b9d97 100644
--- a/post-build-lava.groovy
+++ b/post-build-lava.groovy
@@ -3,53 +3,53 @@ import hudson.model.*
// Add a LAVA job link to the description
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 lavaJobUrl = "http://${lavaServer}/scheduler/job/${lavaJobId}"
- def lavaDescription = "&nbsp;LAVA Job Id: <a href='${lavaJobUrl}'>${lavaJobId}</a>"
-
- def cause = manager.build.getAction(hudson.model.CauseAction.class).getCauses()
- def upstreamBuild = cause[0].upstreamBuild
- def upstreamProject = cause[0].upstreamProject
- def jobName = upstreamProject
- def jobConfiguration = upstreamProject
- def jobUrl = manager.hudson.getRootUrl() + "job/${upstreamProject}/${upstreamBuild}"
- def jobDescription = "<br>&nbsp;Build <a href='${jobUrl}'>${upstreamProject} #${upstreamBuild}</a>"
-
- manager.build.setDescription(lavaDescription + jobDescription)
-
- // Multi-configuration project
- if (upstreamProject.contains("/")) {
- jobName = upstreamProject.split("/")[0]
- jobConfiguration = upstreamProject.split("/")[1]
- }
-
- def jobs = hudson.model.Hudson.instance.getItem(jobName).getAllJobs()
-
- for (job in jobs) {
- if (job.name == jobConfiguration) {
- if (job.getLastBuild().getDescription() != null) {
- lavaDescription += "<br>" + job.getLastBuild().getDescription()
- }
- job.getLastBuild().setDescription(lavaDescription)
+ def lavaJobId = matcher.group(0).split(",")[0].substring(13)
+ def lavaServer = manager.build.buildVariables.get("LAVA_SERVER").split("/")[0]
+ def lavaJobUrl = "http://${lavaServer}/scheduler/job/${lavaJobId}"
+ def lavaDescription = "&nbsp;LAVA Job Id: <a href='${lavaJobUrl}'>${lavaJobId}</a>"
+
+ def cause = manager.build.getAction(hudson.model.CauseAction.class).getCauses()
+ def upstreamBuild = cause[0].upstreamBuild
+ def upstreamProject = cause[0].upstreamProject
+ def jobName = upstreamProject
+ def jobConfiguration = upstreamProject
+ def jobUrl = manager.hudson.getRootUrl() + "job/${upstreamProject}/${upstreamBuild}"
+ def jobDescription = "<br>&nbsp;Build <a href='${jobUrl}'>${upstreamProject} #${upstreamBuild}</a>"
+
+ manager.build.setDescription(lavaDescription + jobDescription)
+
+ // Multi-configuration project
+ if (upstreamProject.contains("/")) {
+ jobName = upstreamProject.split("/")[0]
+ jobConfiguration = upstreamProject.split("/")[1]
}
- }
-
- // Add parameters
- def action = manager.build.getAction(hudson.model.ParametersAction.class)
- def parameters = [
- new StringParameterValue("LAVA_JOB_ID", "${lavaJobId}"),
- new StringParameterValue("BUILD_JOB", "${jobUrl}")
- ]
- updatedAction = action.createUpdated(parameters)
- manager.build.replaceAction(updatedAction)
-
- // Update the pool of jobs to monitor
- job = hudson.model.Hudson.instance.getItem("check-lava-status")
- property = job.getProperty(hudson.model.ParametersDefinitionProperty.class)
- parameter = property.getParameterDefinition("LAVA_JOB_ID_POOL")
- lavaJobIdPool = parameter.getDefaultValue()
- lavaJobIdPool += " ${lavaJobId}"
- parameter.setDefaultValue(lavaJobIdPool)
- job.save()
+
+ def jobs = hudson.model.Hudson.instance.getItem(jobName).getAllJobs()
+
+ for (job in jobs) {
+ if (job.name == jobConfiguration) {
+ if (job.getLastBuild().getDescription() != null) {
+ lavaDescription += "<br>" + job.getLastBuild().getDescription()
+ }
+ job.getLastBuild().setDescription(lavaDescription)
+ }
+ }
+
+ // Add parameters
+ def action = manager.build.getAction(hudson.model.ParametersAction.class)
+ def parameters = [
+ new StringParameterValue("LAVA_JOB_ID", "${lavaJobId}"),
+ new StringParameterValue("BUILD_JOB", "${jobUrl}")
+ ]
+ updatedAction = action.createUpdated(parameters)
+ manager.build.replaceAction(updatedAction)
+
+ // Update the pool of jobs to monitor
+ job = hudson.model.Hudson.instance.getItem("check-lava-status")
+ property = job.getProperty(hudson.model.ParametersDefinitionProperty.class)
+ parameter = property.getParameterDefinition("LAVA_JOB_ID_POOL")
+ lavaJobIdPool = parameter.getDefaultValue()
+ lavaJobIdPool += " ${lavaJobId}"
+ parameter.setDefaultValue(lavaJobIdPool)
+ job.save()
}