public String getEntryTitle(Run entry) { return entry.getFullDisplayName()+" ("+entry.getBuildStatusSummary().message+")"; }
@Override protected R retrieve(File d) throws IOException { if(new File(d,"build.xml").exists()) { // if the build result file isn't in the directory, ignore it. try { R b = cons.create(d); b.onLoad(); if (LOGGER.isLoggable(FINEST)) { LOGGER.log(FINEST, "Loaded " + b.getFullDisplayName() + " in " + Thread.currentThread().getName(), new ThisIsHowItsLoaded()); } return b; } catch (IOException e) { LOGGER.log(Level.WARNING, "could not load " + d, e); } catch (InstantiationError e) { LOGGER.log(Level.WARNING, "could not load " + d, e); } catch (Exception e) { LOGGER.log(Level.WARNING, "could not load " + d, e); } } return null; }
@Override public String getShortDescription() { Run run = getRun(); return name + "=" + ((null == run) ? getJobName() + " #" + getNumber() : run.getFullDisplayName()); }
/** * Performs an installation. */ private int install(ToolInstallation t, BuildIDs id, AbstractProject p) throws IOException, InterruptedException { Run b = p.getBuildByNumber(Integer.parseInt(id.number)); if (b==null) throw new IllegalStateException("No such build: "+id.number); Executor exec = b.getExecutor(); if (exec==null) throw new IllegalStateException(b.getFullDisplayName()+" is not building"); Node node = exec.getOwner().getNode(); if (node == null) { throw new IllegalStateException("The node " + exec.getOwner().getDisplayName() + " has been deleted"); } t = t.translate(node, EnvVars.getRemote(checkChannel()), new StreamTaskListener(stderr)); stdout.println(t.getHome()); return 0; }
public TimelineEventList doData(StaplerRequest req, @QueryParameter long min, @QueryParameter long max) throws IOException { TimelineEventList result = new TimelineEventList(); for (Run r : builds.byTimestamp(min,max)) { Event e = new Event(); e.start = new Date(r.getStartTimeInMillis()); e.end = new Date(r.getStartTimeInMillis()+r.getDuration()); // due to SimileAjax.HTML.deEntify (in simile-ajax-bundle.js), "<" are transformed back to "<", but not the "<"; // to protect against XSS e.title = Util.escape(r.getFullDisplayName()).replace("<", "<"); // what to put in the description? // e.description = "Longish description of event "+r.getFullDisplayName(); // e.durationEvent = true; e.link = req.getContextPath()+'/'+r.getUrl(); BallColor c = r.getIconColor(); e.color = String.format("#%06X",c.getBaseColor().darker().getRGB()&0xFFFFFF); e.classname = "event-"+c.noAnime().toString()+" " + (c.isAnimated()?"animated":""); result.add(e); } return result; }
stdout.println("Started "+b.getFullDisplayName()); stdout.flush(); stdout.println("Completed "+b.getFullDisplayName()+" : "+b.getResult()); return b.getResult().ordinal; } catch (InterruptedException e) {
/** * Deletes the build when the button is pressed. */ @RequirePOST public void doDoDelete( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException { checkPermission(DELETE); // We should not simply delete the build if it has been explicitly // marked to be preserved, or if the build should not be deleted // due to dependencies! String why = getWhyKeepLog(); if (why!=null) { sendError(Messages.Run_UnableToDelete(getFullDisplayName(), why), req, rsp); return; } try{ delete(); } catch(IOException ex){ req.setAttribute("stackTraces", Functions.printThrowable(ex)); req.getView(this, "delete-retry.jelly").forward(req, rsp); return; } rsp.sendRedirect2(req.getContextPath()+'/' + getParent().getUrl()); }
public String getEntryTitle(Run entry) { return entry.getFullDisplayName()+" ("+entry.getBuildStatusSummary().message+")"; }
@CheckForNull public synchronized TriggerEntry finalized(@Nonnull final PushNotification pushNotification, Run<?, ?> run) { try { TriggerEntry entry = getOrCreateEntry(pushNotification); entry.updateEntry(run); save(entry); return entry; } catch (Exception e) { logger.log(Level.SEVERE, "Failed to update finalized info for " + run.getFullDisplayName(), e); return null; } }
public FormValidation doCheckStageName(@QueryParameter String value) { String s = Util.fixEmptyAndTrim(value); if (s == null || s.equals("")) { return FormValidation.error(Messages.RestartDeclarativePipelineAction_NullStageName()); } if (!getRestartableStages().contains(s)) { return FormValidation.error(Messages.RestartDeclarativePipelineAction_StageNameNotPresent(s, run.getFullDisplayName())); } return FormValidation.ok(); }
public synchronized void started(@Nonnull final PushNotification pushNotification, Run<?, ?> run) { try { TriggerEntry entry = getOrCreateEntry(pushNotification); entry.updateEntry(run); save(entry); } catch (Exception e) { logger.log(Level.SEVERE, "Failed to update started info for " + run.getFullDisplayName(), e); } }
@Override public void onStarted(@Nonnull Run<?, ?> run, @Nonnull TaskListener listener) { DockerHubWebHookCause cause = run.getCause(DockerHubWebHookCause.class); if (cause != null) { logger.log(Level.FINER, "Build {0} started for cause: {1}", new Object[]{run.getFullDisplayName(), cause}); TriggerStore.getInstance().started(cause.getPushNotification(), run); } }
@Override public void perform(@Nonnull Run<?, ?> run, @Nonnull FilePath filePath, @Nonnull Launcher launcher, @Nonnull TaskListener taskListener) throws InterruptedException, IOException { String buildInfo = run.getFullDisplayName(); if (!StringUtils.isBlank(message)) { sendMessage(LinkMessage.builder() .title(buildInfo + message) .picUrl(imageUrl) .text(message) .messageUrl((jenkinsUrl.endsWith("/") ? jenkinsUrl : jenkinsUrl + "/") + run.getUrl()) .build()); } }
@Override public String getDisplayName() { // TODO more generic to check whether FlowExecution.owner.executable is a ModelObject Run<?,?> r = runForDisplay(); return r != null ? Messages.DockerNodeStepExecution_PlaceholderTask_displayName(r.getFullDisplayName()) : Messages.DockerNodeStepExecution_PlaceholderTask_displayName_unknown(); }
@Override public void onDeleted(Run<?,?> run) { for (BuildTriggerAction.Trigger trigger : BuildTriggerAction.triggersFor(run)) { trigger.context.onFailure(new AbortException(run.getFullDisplayName() + " was deleted")); } } }
@Override public String getShortDescription() { Run run = getRun(); return name + "=" + ((null == run) ? getJobName() + " #" + getNumber() : run.getFullDisplayName()); }
@Override public String getDisplayName() { // TODO more generic to check whether FlowExecution.owner.executable is a ModelObject Run<?,?> r = runForDisplay(); return r != null ? Messages.DockerNodeStepExecution_PlaceholderTask_displayName(r.getFullDisplayName()) : Messages.DockerNodeStepExecution_PlaceholderTask_displayName_unknown(); }
@Override @Exported public String getFullDisplayName() { initPython(); if (pexec.isImplemented(27)) { return (String) pexec.execPython("get_full_display_name"); } else { return super.getFullDisplayName(); } }
public BuildInfo(Run run) { this.timestamp = run.getTimestamp(); this.url = "/" + run.getUrl(); this.name = run.getFullDisplayName(); this.result = run.isBuilding() ? "Building" : run.getResult().toString(); }
private ContainerTag createReferenceBuildLink(final Run<?, ?> referenceBuild) { String absoluteUrl = jenkins.getAbsoluteUrl(referenceBuild.getUrl(), getId()); return a(referenceBuild.getFullDisplayName()).withHref(absoluteUrl); }