public String getPipelineLabel() { return getIdentifier().getPipelineLabel(); }
String cacheKeyForOriginalJobIdentifier(StageIdentifier stageIdentifier, String jobName) { return cacheKeyGenerator.generate("originalJobIdentifier", stageIdentifier.getPipelineName(), stageIdentifier.getPipelineLabel().toLowerCase(), String.valueOf(stageIdentifier.getPipelineCounter()), stageIdentifier.getStageName().toLowerCase(), stageIdentifier.getStageCounter().toLowerCase(), jobName.toLowerCase()); }
public JobIdentifier(StageIdentifier stage, String jobName) { this(stage.getPipelineName(), stage.getPipelineCounter(), stage.getPipelineLabel(), stage.getStageName(), stage.getStageCounter(), jobName, 0L); }
public JobIdentifier(StageIdentifier stage, String jobName, Long jobId) { this(stage.getPipelineName(), stage.getPipelineCounter(), stage.getPipelineLabel(), stage.getStageName(), stage.getStageCounter(), jobName, jobId); }
public List<Modification> getPassedStagesAfter(final String lastRevision, DependencyMaterial material, Pagination pagination) { StageIdentifier identifier = new StageIdentifier(lastRevision); List<StageAsDMR> passedStagesAfter = stageDao.getPassedStagesAfter(identifier, pagination.getPageSize(), pagination.getOffset()); List<Modification> mods = new ArrayList<>(); for (StageAsDMR stage : passedStagesAfter) { StageIdentifier stageIdentifier = stage.getIdentifier(); Modification modification = new Modification(stage.getCompletedDate(), stageIdentifier.stageLocator(), stageIdentifier.getPipelineLabel(), stage.getPipelineId()); mods.add(modification); } return mods; } }
public JobIdentifier(StageIdentifier stageIdentifier, JobInstance job) { this(stageIdentifier.getPipelineName(), stageIdentifier.getPipelineCounter(), stageIdentifier.getPipelineLabel(), stageIdentifier.getStageName(), stageIdentifier.getStageCounter(), job.getName(), job.getId()); }
public List<Modification> getPassedStagesByName(DependencyMaterial material, Pagination pagination) { Stages stages = stageDao.getPassedStagesByName(CaseInsensitiveString.str(material.getPipelineName()), CaseInsensitiveString.str(material.getStageName()), pagination.getPageSize(), pagination.getOffset()); List<Modification> mods = new ArrayList<>(); for (Stage stage : stages) { StageIdentifier stageIdentifier = stage.getIdentifier(); Modification modification = new Modification(stage.completedDate(), stageIdentifier.stageLocator(), stageIdentifier.getPipelineLabel(), stage.getPipelineId()); mods.add(modification); } return mods; }
@Override public StageNotificationDTO transformData() { String pipelineName = stage.getIdentifier().getPipelineName(); Integer pipelineCounter = stage.getIdentifier().getPipelineCounter(); String pipelineLabel = stage.getIdentifier().getPipelineLabel(); StageNotificationDTO.PipelineDTO pipeline = new StageNotificationDTO.PipelineDTO(pipelineName, pipelineCounter, pipelineLabel, pipelineGroup, createBuildCause(buildCause), createStageDTO()); return new StageNotificationDTO(pipeline); }
@Override public StageNotificationDTO transformData() { String pipelineName = stage.getIdentifier().getPipelineName(); Integer pipelineCounter = stage.getIdentifier().getPipelineCounter(); String pipelineLabel = stage.getIdentifier().getPipelineLabel(); StageNotificationDTO.PipelineDTO pipeline = new StageNotificationDTO.PipelineDTO(pipelineName, pipelineCounter, pipelineLabel, pipelineGroup, createBuildCause(buildCause), createStageDTO()); return new StageNotificationDTO(pipeline); }
@Override public StageNotificationDTO transformData() { String pipelineName = stage.getIdentifier().getPipelineName(); Integer pipelineCounter = stage.getIdentifier().getPipelineCounter(); String pipelineLabel = stage.getIdentifier().getPipelineLabel(); StageNotificationDTO.PipelineDTO pipeline = new StageNotificationDTO.PipelineDTO(pipelineName, pipelineCounter, pipelineLabel, pipelineGroup, createBuildCause(buildCause), createStageDTO()); return new StageNotificationDTO(pipeline); }
public Stage findStageWithIdentifier(StageIdentifier identifier) { String cachekey = cacheKeyForStageIdentifier(identifier); String cacheKeyForIdentifiers = cacheKeyForListOfStageIdentifiers(identifier); synchronized (cacheKeyForIdentifiers) { Stage stage = (Stage) goCache.get(cacheKeyForIdentifiers, cachekey); if (stage == null) { IBatisUtil.IBatisArgument argument = IBatisUtil.arguments("pipelineName", identifier.getPipelineName()) .and("pipelineCounter", identifier.getPipelineCounter()) .and("stageName", identifier.getStageName()) .and("stageCounter", Integer.parseInt(identifier.getStageCounter())); if (identifier.getPipelineLabel() != null) { argument = argument.and("pipelineLabel", identifier.getPipelineLabel()); } Map arguments = argument.asMap(); stage = (Stage) getSqlMapClientTemplate().queryForObject("findStageWithJobsByIdentifier", arguments); if (stage == null) { return new NullStage(identifier.getStageName()); } goCache.put(cacheKeyForIdentifiers, cachekey, stage); } return cloner.deepClone(stage); } }
public Document toXml(XmlWriterContext writerContext) { DOMElement root = new DOMElement("stage"); root.addAttribute("name", stage.getName()).addAttribute("counter", String.valueOf(stage.getCounter())); Document document = new DOMDocument(root); root.addElement("link").addAttribute("rel", "self").addAttribute("href", httpUrl(writerContext.getBaseUrl())); StageIdentifier stageId = stage.getIdentifier(); root.addElement("id").addCDATA(stageId.asURN()); String pipelineName = stageId.getPipelineName(); root.addElement("pipeline").addAttribute("name", pipelineName) .addAttribute("counter", String.valueOf(stageId.getPipelineCounter())) .addAttribute("label", stageId.getPipelineLabel()) .addAttribute("href", writerContext.getBaseUrl() + "/api/pipelines/" + pipelineName + "/" + stage.getPipelineId() + ".xml"); root.addElement("updated").addText(DateUtils.formatISO8601(stage.latestTransitionDate())); root.addElement("result").addText(stage.getResult().toString()); root.addElement("state").addText(stage.status()); root.addElement("approvedBy").addCDATA(stage.getApprovedBy()); Element jobs = root.addElement("jobs"); for (JobInstance jobInstance : stage.getJobInstances()) { jobs.addElement("job").addAttribute("href", writerContext.getBaseUrl() + "/api/jobs/" + jobInstance.getId() + ".xml"); } return document; }
.addAttribute("label", stageId.getPipelineLabel());