Ajith, I’m sure you can use a Post-build “Groovy Post-Build” to read the log (build.getLog maybe) and the write it to a file in the workspace. There might be a easier way and this code has not been “tested”.
Try something like this:
Log = build.getLog();
// is we are running on a remote slave, we need the channel
if (manager.build.workspace.isRemote()) {
channel = manager.build.workspace.channel;
}
// create a FilePath object to use to write into the remote workspace
fp = new hudson.FilePath(channel, build.workspace.toString() + "\\log.filename")
if (fp != null) {
fp.write(Log, null);
--
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
jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/f0b1f482-6979-44ee-9b17-52c39ad33928%40googlegroups.com.
For more options, visit
https://groups.google.com/d/optout.
buildLogPath="../builds/$BUILD_NUMBER/log"
buildLogPath="../builds/$BUILD_NUMBER/log" cat $buildLogPath > ./build.log.copy
# run reports asynchronously doreportrs ./build.log.copy &
And the error was??
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/46d640fc-22a9-46a4-b5a3-7afe50812066%40googlegroups.com.
+ ls -lrt total 0 -rw-r--r-- 1 jenkins jenkins 0 Jun 15 06:25 build.log.copy ERROR: Failed to evaluate groovy script. groovy.lang.MissingPropertyException: No such property: build for class: Script1 at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:53) at org.codehaus.groovy.runtime.callsite.PogoGetPropertySite.getProperty(PogoGetPropertySite.java:52) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGroovyObjectGetProperty(AbstractCallSite.java:307) at Script1.run(Script1.groovy:1) at groovy.lang.GroovyShell.evaluate(GroovyShell.java:585) at groovy.lang.GroovyShell.evaluate(GroovyShell.java:623) at groovy.lang.GroovyShell.evaluate(GroovyShell.java:594) at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SecureGroovyScript.evaluate(SecureGroovyScript.java:168) at org.jvnet.hudson.plugins.groovypostbuild.GroovyPostbuildRecorder.perform(GroovyPostbuildRecorder.java:362) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:720) at hudson.model.Build$BuildExecution.post2(Build.java:185) at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:665) at hudson.model.Run.execute(Run.java:1766) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:410)