Search in sources :

Example 1 with ReplayAction

use of org.jenkinsci.plugins.workflow.cps.replay.ReplayAction in project blueocean-plugin by jenkinsci.

the class PipelineRunImpl method replay.

@Override
public BlueQueueItem replay() {
    ReplayAction replayAction = run.getAction(ReplayAction.class);
    if (replayAction == null) {
        throw new ServiceException.BadRequestExpception("This run does not support replay");
    }
    Queue.Item item = replayAction.run2(replayAction.getOriginalScript(), replayAction.getOriginalLoadedScripts());
    BlueQueueItem queueItem = QueueContainerImpl.getQueuedItem(item, run.getParent());
    if (queueItem == null) {
        throw new ServiceException.UnexpectedErrorException("Run was not added to queue.");
    } else {
        return queueItem;
    }
}
Also used : ReplayAction(org.jenkinsci.plugins.workflow.cps.replay.ReplayAction) Queue(hudson.model.Queue) BlueQueueItem(io.jenkins.blueocean.rest.model.BlueQueueItem)

Aggregations

Queue (hudson.model.Queue)1 BlueQueueItem (io.jenkins.blueocean.rest.model.BlueQueueItem)1 ReplayAction (org.jenkinsci.plugins.workflow.cps.replay.ReplayAction)1