Search code examples
jenkinsjenkins-pluginsemail-ext

Getting Logs from child project created in Jenkins Parameterized Build Plugin for Email Ext plugin


I have successfully created parent child project in Jenkins using Parameterized Build Plugin but the problem i faced is when i am attaching logs to our team whenever a build fail.

The email-ext plugin is sending email with build log of parent project which is just a calling project and not the logs of child project.

Any help is highly appreciated.


Solution

  • Ok so i got the solution. I need to discard the Pramaeterized plugin but now is using the Build flow Plugin [https://wiki.jenkins-ci.org/display/JENKINS/Build+Flow+Plugin]

    The benefit is it is giving me the log to be placed in the parent job without any modification in the child project.

    the usage is as follows:

    def today = new Date()
    out.println '----------------- Build Started At '+ today+ '----------------------------'
    b=build("<BaseBuild>",ParentWorkSpace:build.properties["workspace"],Param:"Value")
    today=new Date()
    out.println '--------       Build Log    --------------   '
    out.println b.log
    out.println '----------------- Build Ended At '+ today+ '----------------------------'
    

    This way i have full control and when i attach the log then i am attaching the original log in my email :)

    I hope it will help many.