Skip to content

Instantly share code, notes, and snippets.

@gilgamez
Created January 23, 2013 07:14
Show Gist options
  • Save gilgamez/4602785 to your computer and use it in GitHub Desktop.
Save gilgamez/4602785 to your computer and use it in GitHub Desktop.
def workspace = manager.build.workspace
def matcher = manager.getLogMatcher(".*Messages transferred +: (\\d+).*")
def writeToCsv(csv, text) {
csv.act({f,c->f.withWriterAppend("UTF-8") { it.write(text + "\n") }} as hudson.FilePath.FileCallable<Void>)
}
if(matcher?.matches()) {
def result = matcher.group(1)
def csv = workspace.child("messages_transferred.csv")
if (!csv.exists()) {writeToCsv(csv, "transferred")}
writeToCsv(csv, matcher.group(1))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment