I am working on OpenStack Cloud plugin to introduce Declarative
Pipeline option. The feature is nearly done, all I need is to
delete the OpenStack machine which is supposed to be only
temporary and removed once the job is finished.
I am not sure which method to call from Workflow step api plugin.
It needs to run ((JCloudsComputer)
as it is in public void stop method. But probably somewhere else?
Should I extend something else than SynchronousNonBlockingStepExecution?
On Wed, May 16, 2018 at 4:05 PM, Denis Richtárik
<[hidden email]> wrote:
> It needs to run ((JCloudsComputer) newSlave.toComputer()).deleteSlave(); as
> it is in public void stop method. But probably somewhere else? Should I
> extend something else than SynchronousNonBlockingStepExecution?
`stop` will not be called at all typically, and I do not think you
meant for this to be a synchronous step: it looks quite likely to take
more than a trivial amount of time to run, and you need to do cleanup,
meaning that you want a block-scoped step which can do some work
(ideally asynchronously), then invoke its body, then do more work when
the body exits.
It is possible, though not simple, to write something very much like
what you are attempting; while I do not vouch for every detail, you
can look at