Hi,
Is there a way to add something to the description or to a build page in general, but not to the build history?

So far, I came up with adding some spacers, but they make the build history taller (add blank vertical space). I specifically want to use Groovy because I already have a script in Groovy that builds the log.

I'm using this in Groovy:

``` import hudson.FilePath def appendFileToBuildPage(build, filePath, title) { // FilePath = compatible with running on remote nodes def logFile = new FilePath(build.workspace, filePath) def newContent = "" // Check file and add its content on the build page if (logFile.exists()) { // spacers (should *not* show h2 in build history) newContent += "\n<p>(${title.toLowerCase()} available on the build page)</p>" newContent += "<p>&nbsp;</p>" newContent += "<p>&nbsp;</p>" newContent += "<p>&nbsp;</p>" // actual content newContent += "\n<h2>${title}</h2>\n<pre>${logFile.readToString()}</pre>" newContent += "\n<hr>" } else { newContent += "<p>(the ${title.toLowerCase()} file is missing: ${filePath})</p>" } // Append content to the description def existingDescription = build.getDescription() ?: "" build.setDescription(existingDescription + newContent) } // append short info appendFileToBuildPage(build, "logs/short.log.wiki", "Short log")

```

Cheers / Regards,
Maciej

--
You received this message because you are subscribed to the Google Groups "Jenkins 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/jenkinsci-users/53aba33a-c02f-a59c-f59e-bbbba152b7d3%40mol.com.pl.

Reply via email to