Pin build flows to a slave the same way you pin jobs to slaves -- using labels. And FWIW, since build flows are light-weight tasks that use one-off executors (i.e. it creates its own temporary executor that has no number in the list), it can always execute on the same node. Unless the node is unavailable or (possibly) you're using a different executor assignment strategy (e.g. Even Load Strategy plugin), it will always execute on the same node. But I don't know whether the node makes any difference for file accesses anyway (or just for scheduling), the DSL could actually be evaluated on the master every time.
Regarding the second question: You can run arbitrary code. Jenkins and its plugins are open source. You're a developer. Go nuts. The following example simply adds the previous flow run's HTML report to the current one (a simpler example might have been to just use `.previousBuild.logFile.text`): def reportsDir =Thread.currentThread().currentWorkspace.child('reports') def previousPublisher = Thread.currentThread().currentExecutable.previousBuild.actions.find { it.class.name == 'htmlpublisher.HtmlPublisherTarget$HTMLBuildAction' } def oldText = new File(previousPublisher.dir(), 'index.html').text reportsDir.mkdirs() reportsDir.child('index.html').write('<pre>' + Thread.currentThread().currentExecutable.log + '</pre>' + oldText, 'UTF-8') On 07.08.2013, at 23:19, Bob Bick <bb...@netjets.com> wrote: > Daniel, > > We run Jenkins in a multi-node environment. If the Build Flow job always runs > on the same Jenkins node, then I think your solution will work fine. But, if > they do not run on the same node, then I will not have the history of > previous job runs in order to generate a comprehensive report. > > Is there a way to pin a Build Flow job to a specific node? Or, perhaps I > could publish results after each run to the master Jenkins node, that could > then be downloaded to the currently running slave (i.e. the master node keeps > the history)? I have no clue if that is even possible... > > Sorry for all these newbie questions. > > Thanks, > > Bob > > -----Original Message----- > From: jenkinsci-users@googlegroups.com > [mailto:jenkinsci-users@googlegroups.com] On Behalf Of Daniel Beck > Sent: Wednesday, August 07, 2013 2:52 PM > To: jenkinsci-users@googlegroups.com > Subject: Re: Build Flow Plugin - reporting capability > > 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 <bb...@netjets.com> 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: jenkinsci-users@googlegroups.com >> [mailto:jenkinsci-users@googlegroups.com] On Behalf Of nicolas de loof >> Sent: Wednesday, August 07, 2013 2:56 AM >> To: jenkinsci-users@googlegroups.com >> 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 <bb...@netjets.com> >> 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 jenkinsci-users+unsubscr...@googlegroups.com. >> 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 jenkinsci-users+unsubscr...@googlegroups.com. >> 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 jenkinsci-users+unsubscr...@googlegroups.com. >> 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 jenkinsci-users+unsubscr...@googlegroups.com. > 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 jenkinsci-users+unsubscr...@googlegroups.com. > 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 jenkinsci-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.