Below is the error. I am just listing my directory in the shell. In post 
build section creating a groovy script.

+ 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 
<http://stacktrace.jenkins-ci.org/search?query=groovy.lang.MissingPropertyException>:
 No such property: build for class: Script1
        at 
org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:53)
 
<http://stacktrace.jenkins-ci.org/search/?query=org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap&entity=method>
        at 
org.codehaus.groovy.runtime.callsite.PogoGetPropertySite.getProperty(PogoGetPropertySite.java:52)
 
<http://stacktrace.jenkins-ci.org/search/?query=org.codehaus.groovy.runtime.callsite.PogoGetPropertySite.getProperty&entity=method>
        at 
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGroovyObjectGetProperty(AbstractCallSite.java:307)
 
<http://stacktrace.jenkins-ci.org/search/?query=org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGroovyObjectGetProperty&entity=method>
        at Script1.run(Script1.groovy:1) 
<http://stacktrace.jenkins-ci.org/search/?query=Script1.run&entity=method>
        at groovy.lang.GroovyShell.evaluate(GroovyShell.java:585) 
<http://stacktrace.jenkins-ci.org/search/?query=groovy.lang.GroovyShell.evaluate&entity=method>
        at groovy.lang.GroovyShell.evaluate(GroovyShell.java:623) 
<http://stacktrace.jenkins-ci.org/search/?query=groovy.lang.GroovyShell.evaluate&entity=method>
        at groovy.lang.GroovyShell.evaluate(GroovyShell.java:594) 
<http://stacktrace.jenkins-ci.org/search/?query=groovy.lang.GroovyShell.evaluate&entity=method>
        at 
org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SecureGroovyScript.evaluate(SecureGroovyScript.java:168)
 
<http://stacktrace.jenkins-ci.org/search/?query=org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SecureGroovyScript.evaluate&entity=method>
        at 
org.jvnet.hudson.plugins.groovypostbuild.GroovyPostbuildRecorder.perform(GroovyPostbuildRecorder.java:362)
 
<http://stacktrace.jenkins-ci.org/search/?query=org.jvnet.hudson.plugins.groovypostbuild.GroovyPostbuildRecorder.perform&entity=method>
        at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) 
<http://stacktrace.jenkins-ci.org/search/?query=hudson.tasks.BuildStepMonitor$1.perform&entity=method>
        at 
hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
 
<http://stacktrace.jenkins-ci.org/search/?query=hudson.model.AbstractBuild$AbstractBuildExecution.perform&entity=method>
        at 
hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:720)
 
<http://stacktrace.jenkins-ci.org/search/?query=hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps&entity=method>
        at hudson.model.Build$BuildExecution.post2(Build.java:185) 
<http://stacktrace.jenkins-ci.org/search/?query=hudson.model.Build$BuildExecution.post2&entity=method>
        at 
hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:665) 
<http://stacktrace.jenkins-ci.org/search/?query=hudson.model.AbstractBuild$AbstractBuildExecution.post&entity=method>
        at hudson.model.Run.execute(Run.java:1766) 
<http://stacktrace.jenkins-ci.org/search/?query=hudson.model.Run.execute&entity=method>
        at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) 
<http://stacktrace.jenkins-ci.org/search/?query=hudson.model.FreeStyleBuild.run&entity=method>
        at hudson.model.ResourceController.execute(ResourceController.java:98) 
<http://stacktrace.jenkins-ci.org/search/?query=hudson.model.ResourceController.execute&entity=method>
        at hudson.model.Executor.run(Executor.java:410) 
<http://stacktrace.jenkins-ci.org/search/?query=hudson.model.Executor.run&entity=method>


Thanks,
Ajith

On Wednesday, June 15, 2016 at 4:56:47 PM UTC+5:30, rginga wrote:
>
> And the error was??
>
>  
>
> *From:* [email protected] <javascript:> [mailto:
> [email protected] <javascript:>] *On Behalf Of *AJITH K.R
> *Sent:* Wednesday, June 15, 2016 6:17 AM
> *To:* Jenkins Users
> *Subject:* Re: Need help on usage of Jenkins console data
>
>  
>
> Thanks for the suggestion. I am completely new to groovy and I tried 
> executing the script in post groovy step but it failed in step build.getLog() 
> :-(.
>
> On Tuesday, June 14, 2016 at 5:46:45 PM UTC+5:30, rginga wrote:
>
> 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);
>
> }
>
>  
>
> *From:* [email protected] [mailto:[email protected]] *On 
> Behalf Of *AJITH K.R
> *Sent:* Tuesday, June 14, 2016 6:35 AM
> *To:* Jenkins Users
> *Subject:* Need help on usage of Jenkins console data
>
>  
>
> Hi All,
>
>  
>
> How can I get the console output information of Jenkins build under the 
> workspace. I need to use it as an input for reporting purpose. 
>
>  
>
> Thanks,
>
> Ajith
>
> -- 
> 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 on the web visit 
> https://groups.google.com/d/msgid/jenkinsci-users/f0b1f482-6979-44ee-9b17-52c39ad33928%40googlegroups.com
>  
> <https://urldefense.proofpoint.com/v2/url?u=https-3A__groups.google.com_d_msgid_jenkinsci-2Dusers_f0b1f482-2D6979-2D44ee-2D9b17-2D52c39ad33928-2540googlegroups.com-3Futm-5Fmedium-3Demail-26utm-5Fsource-3Dfooter&d=CwMFaQ&c=3mGIBQKb1eS1YDHb7ax3kFkT2UAGBJ12p2lcECIjhXk&r=SXz9subj7EUWDFIuiAjJSXBLM9pAzGIduhHWvfq5re0&m=gI_Z6d1tPCnjyoBOU8bfj3A0GY5KaYGPhaKbihHYboo&s=c3MUjJiw8kW2GxkYZJQpk4IXsJCdt9EzGkU-tbKPFEI&e=>
> .
> For more options, visit https://groups.google.com/d/optout 
> <https://urldefense.proofpoint.com/v2/url?u=https-3A__groups.google.com_d_optout&d=CwMFaQ&c=3mGIBQKb1eS1YDHb7ax3kFkT2UAGBJ12p2lcECIjhXk&r=SXz9subj7EUWDFIuiAjJSXBLM9pAzGIduhHWvfq5re0&m=gI_Z6d1tPCnjyoBOU8bfj3A0GY5KaYGPhaKbihHYboo&s=hGIHR2SporUecnxVW1vlyEzdKTAJy93KEvRlTA9f5IY&e=>
> .
>
> -- 
> 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] <javascript:>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/jenkinsci-users/46d640fc-22a9-46a4-b5a3-7afe50812066%40googlegroups.com
>  
> <https://urldefense.proofpoint.com/v2/url?u=https-3A__groups.google.com_d_msgid_jenkinsci-2Dusers_46d640fc-2D22a9-2D46a4-2Db5a3-2D7afe50812066-2540googlegroups.com-3Futm-5Fmedium-3Demail-26utm-5Fsource-3Dfooter&d=CwMFaQ&c=3mGIBQKb1eS1YDHb7ax3kFkT2UAGBJ12p2lcECIjhXk&r=SXz9subj7EUWDFIuiAjJSXBLM9pAzGIduhHWvfq5re0&m=KOl1ytdrYJzTgkBzBsaKh0rQs7Ksxbsm_YZ4B5FcP7Y&s=pIzWYiyOWPug_ctS_MpJNuvVmQxfrFh5dhJyDDlIoH8&e=>
> .
> For more options, visit https://groups.google.com/d/optout 
> <https://urldefense.proofpoint.com/v2/url?u=https-3A__groups.google.com_d_optout&d=CwMFaQ&c=3mGIBQKb1eS1YDHb7ax3kFkT2UAGBJ12p2lcECIjhXk&r=SXz9subj7EUWDFIuiAjJSXBLM9pAzGIduhHWvfq5re0&m=KOl1ytdrYJzTgkBzBsaKh0rQs7Ksxbsm_YZ4B5FcP7Y&s=xvGoRa8Kvbf5bG1tSh2AlEM2yZzw2PJ09Fne58WWomo&e=>
> .
>

-- 
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 on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/687344ef-47d2-4df7-b082-d0e56bcfb115%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to