Hi,

I was wondering if it is possible to "integrate" heavy-job-plugin 
functionality into pipeline projects.

The result I aim for is something (more or less) like this to be available 
from the pipeline:

bookExecutors(20) {
    sh 'make -j20`
}

Which should mark/reserve 20 executors (19 actually -- one would be used by 
make)
on the node on which make invocation takes place.

Currently I derived from org.jenkinsci.plugins.workflow.steps.Step,
so I can run my "plugin" directly from the pipeline. But I have no idea how 
to "reserve" or
"mark as busy" some executors.

Is it even possible?

I tried to add analogous JobProperty to the one defined in heavy-job-plugin 
[1] via:

    public boolean start() throws Exception {

        final StepContext context = getContext();
        final Job job = run.getParent();
        final Run run = context.get(Run.class);

        job.addProperty(...);

        context.newBodyInvoker().
withCallback(BodyExecutionCallback.wrap(context)).start();
        return false;
    }

But it didn't work.

Any ideas on how I should attack the problem?

Thanks,

TGM

Refs:
[1] 
https://github.com/jenkinsci/heavy-job-plugin/blob/master/src/main/java/hudson/plugins/heavy_job/HeavyJobProperty.java

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/9ddb6de1-ab6e-4191-b5a4-527385217c76%40googlegroups.com.

Reply via email to