@Override public void onFailure(StepContext context, Throwable t) { BuildState state = t instanceof FlowInterruptedException ? BuildState.canceled : BuildState.failed; CommitStatusUpdater.updateCommitStatus(run, getTaskListener(context), state, name, step.builds, step.connection); context.onFailure(t); } })
@Override public void onFailure(StepContext context, Throwable t) { PendingBuildsAction action = run.getAction(PendingBuildsAction.class); if (action != null) { BuildState state = t instanceof FlowInterruptedException ? BuildState.canceled : BuildState.failed; for (String name : action.getBuilds()) { CommitStatusUpdater.updateCommitStatus(run, getTaskListener(context), state, name); } } context.onFailure(t); } })
@Override public void onFailure(StepContext context, Throwable t) { execution.cleanUp(); context.onFailure(t); }
@Override public final void onFailure(StepContext context, Throwable t) { try { finished(context); } catch (Exception x) { t.addSuppressed(x); } context.onFailure(t); }
/** * {@inheritDoc} */ @Override public void stop(@Nonnull Throwable cause) throws Exception { getContext().onFailure(cause); } }
@Override public void run() { stopTask = null; if (recurrencePeriod > 0) { recurrencePeriod = 0; logger().println("After 10s process did not stop"); getContext().onFailure(cause); } } }, 10, TimeUnit.SECONDS);
@Override public void onFailure(StepContext context, Throwable t) { try (KubernetesFacade kubernetes = new KubernetesFacade()){ kubernetes.deletePod(podName); } catch (IOException e) { LOGGER.warning("Failed to properly cleanup"); } finally { context.onFailure(t); } } }
@Override public void onResume() { try { // Pipeline get resumed after jenkins reboot if (nodeName == null) { start(); } } catch (Exception x) { // JENKINS-40161 getContext().onFailure(x); } }
@Override public final void onSuccess(StepContext context, Object result) { try { finished(context); } catch (Exception x) { context.onFailure(x); return; } context.onSuccess(result); }
@Deprecated protected void inject() { try { AbstractStepImpl.prepareInjector(getContext(), null).injectMembers(this); } catch (Exception e) { getContext().onFailure(e); } } }
@Override public final boolean start() throws Exception { executing = Thread.currentThread(); try { getContext().onSuccess(run()); } catch (Throwable t) { getContext().onFailure(t); } finally { executing = null; } return true; }
@Override public void onLeft(Queue.LeftItem li) { if (li.isCancelled()) { if (li.task instanceof PlaceholderTask) { (((PlaceholderTask) li.task).context).onFailure(new AbortException(Messages.ExecutorStepExecution_queue_task_cancelled())); } } }
@Override public final boolean start() throws Exception { executing = Thread.currentThread(); try { getContext().onSuccess(run()); } catch (Throwable t) { getContext().onFailure(t); } finally { executing = null; } return true; }
@Override public void onDeleted(Run<?,?> run) { for (BuildTriggerAction.Trigger trigger : BuildTriggerAction.triggersFor(run)) { trigger.context.onFailure(new AbortException(run.getFullDisplayName() + " was deleted")); } } }
@Override public void onLeft(Queue.LeftItem li) { if (li.isCancelled()) { if (li.task instanceof PlaceholderTask) { (((PlaceholderTask) li.task).context).onFailure(new AbortException(Messages.DockerNodeStepExecution_queue_task_cancelled())); } } }
@Override public boolean onStart(SessionManager sessionManager) { try { sessionManager.createEnvironment(session); getContext().onSuccess(true); } catch (Throwable t) { getContext().onFailure(t); } return true; }
@Override public void onLeft(Queue.LeftItem li) { if(li.isCancelled()){ for (BuildTriggerAction.Trigger trigger : BuildTriggerAction.triggersFor(li)) { trigger.context.onFailure(new AbortException("Build of " + li.task.getFullDisplayName() + " was cancelled")); } } }
@Override public boolean onStart(SessionManager sessionManager) { try { sessionManager.createEnvironment(session); getContext().onSuccess(true); } catch (Throwable t) { getContext().onFailure(t); } return true; }
private void handleQGStatus(String status) { if (step.isAbortPipeline() && !"OK".equals(status)) { getContext().onFailure(new AbortException("Pipeline aborted due to quality gate failure: " + status)); } else { getContext().onSuccess(new QGStatus(status)); } }
@Override public void stop(Throwable cause) throws Exception { PauseAction.endCurrentPause(getContext().get(FlowNode.class)); SonarQubeWebHook.get().removeListener(this); getContext().onFailure(cause); }