I expect sandboxing (JENKINS-16980) to allow accessing
AbstractBuild.getLog() for a job that has been triggered by the flow, this
is a fully valid usage.


2013/8/7 Daniel Beck <[email protected]>

> Build flows are arbitrary Groovy code (hence JENKINS-16980, which will
> break this solution if ever properly implemented). So just add log parsing
> and such to the end of your build flow. The following minimal example takes
> the current build's log so far, and writes it into a file in a new folder
> in the workspace:
>
>         def reportsDir
> =Thread.currentThread().currentWorkspace.child('reports')
>         reportsDir.mkdirs()
>         reportsDir.child('index.html').write('<pre>' +
> Thread.currentThread().currentExecutable.log  + '<pre>', 'UTF-8')
>
> There might even be nicer solutions for determining information about what
> was(n't) built, like using FlowRun's getJobsGraph().
>
> Now, publish that folder's contents using the HTML Publisher plugin's
> "Publish HTML Reports" post-build step.
>
> On 07.08.2013, at 18:03, Bob Bick <[email protected]> wrote:
>
> > After doing some playing with the Jenkins Script Console, I think the
> best approach is to use Groovy scripting.
> >
> > The Jenkins FreeStyleBuild class has a getLog() method that returns a
> string of the log.
> >
> > This is the first time that I have used the Script Console, and it seems
> to be a nice tool. I’d like to expose the information as a nice web page in
> Jenkins, but assume that is not really feasible. So, right now, I am
> thinking to just have a the users run a groovy script with text output.
> >
> > From: [email protected] [mailto:
> [email protected]] On Behalf Of nicolas de loof
> > Sent: Wednesday, August 07, 2013 2:56 AM
> > To: [email protected]
> > Subject: Re: Build Flow Plugin - reporting capability
> >
> > you probably can use jenkins REST API to retrieve the list of executed
> jobs from a build flow execution, not sure yet
> >
> >
> > 2013/8/6 Bob Bick <[email protected]>
> > Hi,
> >
> > The Jenkins Build Flow Plugin is replacing our “massive” home grown
> build system.
> >
> > A couple of times a year, our build team will create a Build Flow job
> from a template to perform the “massive” build which can last for several
> days.
> >
> > The build team will execute the Build Flow job until all sub-jobs have
> been successfully built. The build team can choose to build 50% of the jobs
> on a given day and then build the other 50% the next day (or however they
> decide to break it up)… That leads to my question…. I’d like to be able to
> inform the builders which sub-jobs have been completed within the context
> of the massive Build Flow job. Currently, that information is written to
> the Console Log  as shown below:
> >
> > ######################
> > ###    RESULTS     ###
> > ######################
> > SUCCESS  : JOB1 JOB2 JOB3
> > SKIPPED  : NAF_WPF_NET
> > ABORTED  :
> > FAILURE  : GERMAINE
> > UNSTABLE :
> > NOT BUILT: MIDTIER ESL XRDS1 RULES NAF_NET
> > ##########################
> > ###    END RESULTS     ###
> > ##########################
> >
> > Currently, the build team must scan all the console logs in order  to
> determine what has/has not been built, and to figure out what they still
> need to build. This is difficult for them since there are about 50
> different projects that must be built. I am trying to find a solution that
> would allow them to determine what still needs to be built. Here are a
> couple of ideas:
> >
> > 1)      In the “Build History”, change the job names to include all of
> the sub-jobs that were successfully built for that job run (e.g. change
> “#21” to “#21 JOB1 JOB2 JOB3”). But, I don’t think there is a way to do
> that for Build Flow jobs. Does anyone know if this is possible?
> >
> > 2)      Write a shell script that reads the console log files. However,
> this is a poor solution since it does not integrate with Jenkins (i.e. run
> some script outside of Jenkins).
> >
> > 3)      Other???
> >
> >
> > Q. Can anyone think of a good way to report all of the sub-jobs that
> have successfully completed within the context of multiple Build Flow job
> runs?
> >
> > Thank you for taking the time to read this.
> >
> > Bob
> >
> > *** *** ***
> > This message contains information which may be confidential and
> privileged. Unless you are the addressee (or authorized to receive for the
> addressee), you may not use, copy or disclose to anyone the message or any
> information contained in the message. If you have received the message in
> error,  please advise the sender by reply e-mail and delete the message.
> >
> > --
> > 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].
> > For more options, visit https://groups.google.com/groups/opt_out.
> >
> >
> >
> > --
> > 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].
> > For more options, visit https://groups.google.com/groups/opt_out.
> >
> >
> >
> > *** *** ***
> > This message contains information which may be confidential and
> privileged. Unless you are the addressee (or authorized to receive for the
> addressee), you may not use, copy or disclose to anyone the message or any
> information contained in the message. If you have received the message in
> error,  please advise the sender by reply e-mail and delete the message.
> >
> >
> > --
> > 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].
> > For more options, visit https://groups.google.com/groups/opt_out.
>
> --
> 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].
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to