2012/10/26 Max Spring <[email protected]>: > This is cool. I'm able to run the test code. > > How would I add more configuration elements? > > How can I "inherit" most of the configuration elements from a free-style job > type? > E.g. the trigger elements and the post-build elements could make sense in > the workflow context, too. > Build parameter, cleanup definition, etc.
You'd basically have to cut&paste from AbstractProject. Many of these things are tied to the AbstractProject semantics of synchronous execution, so they'll be unlikely to work with this. For example, Builder, Publisher, SCM and so on all assume the model that doesn't make sense for this. So let's see, what do you want. Trigger. What else? Maybe there's an opportunity to introduce additional type variable so that BuildSteps can opt to work on AsyncRun (or other types, such as ExternalRun), much like JobProperty subtypes can choose what subtypes of Job it can work with. > The build duration is not properly captured. > It should be the entire time a build is active. Ah yes, thanks, I'll fix this. > Interesting: > > - The state of an async job "survives" a Jenkins restart. > > - I can launch more than one async job (that's what I want). > I can see that in other contexts this should be configurable. It already is. See AsyncJob.isConcurrentBuild() > Maybe a callback "boolean canStart(...)"? > If it says false, the job build request gets into the build queue. > I guess there's no need for me to look into the Drools plugin. > > -Max > > > > On 10/26/2012 11:56 AM, Kohsuke Kawaguchi wrote: >> >> I implemented an abstract subtype of Job/Run that can be used to model >> external asynchronous execution. See [1,2]. >> >> While asynchronous process is ongoing, additional lines can be written >> to console. When it's done, you call the markCompleted() method >> to really end the build. >> >> The original driver for this effort was the Jenkow plugin, which wants >> to capture the execution of a workflow as a build, >> but I think it's an useful building block for other plugins. >> >> The plugin has an example of how to use these base types in its >> src/test/java. >> >> [1] https://wiki.jenkins-ci.org/display/JENKINS/Async+Job+Plugin >> [2] https://github.com/jenkinsci/async-job-plugin > > -- Kohsuke Kawaguchi
