use of com.thoughtworks.go.domain.Pipeline in project gocd by gocd.
the class BackupServiceH2IntegrationTest method saveAPipeline.
private Pipeline saveAPipeline() {
PipelineConfig pipelineConfig = PipelineConfigMother.pipelineConfig("pipeline", new StageConfig(new CaseInsensitiveString("stage"), new JobConfigs(new JobConfig("job-one"))));
pipelineConfig.materialConfigs().clear();
SvnMaterialConfig onDirOne = MaterialConfigsMother.svnMaterialConfig("google.com", "dirOne", "loser", "boozer", false, "**/*.html");
pipelineConfig.addMaterialConfig(onDirOne);
Pipeline building = PipelineMother.building(pipelineConfig);
return dbHelper.savePipelineWithMaterials(building);
}
use of com.thoughtworks.go.domain.Pipeline in project gocd by gocd.
the class CachedCurrentActivityService method stagesModel.
private List<StageJsonPresentationModel> stagesModel(PipelineConfig pipelineConfig) {
List<StageJsonPresentationModel> presenters = new ArrayList<>();
for (StageConfig stageConfig : pipelineConfig) {
Stage mostRecentStage = stageService.mostRecentStageWithBuilds(CaseInsensitiveString.str(pipelineConfig.name()), stageConfig);
Pipeline pipeline = pipelineService.pipelineWithModsByStageId(CaseInsensitiveString.str(pipelineConfig.name()), mostRecentStage.getId());
presenters.add(stageModel(pipeline, mostRecentStage));
}
return presenters;
}
use of com.thoughtworks.go.domain.Pipeline in project gocd by gocd.
the class PropertiesController method jobsSearch.
@RequestMapping("/repository/restful/properties/jobs/search")
public ModelAndView jobsSearch(@RequestParam("pipelineName") String pipelineName, @RequestParam("stageName") String stageName, @RequestParam("jobName") String jobName, @RequestParam(value = "limitPipeline", required = false) String limitPipeline, @RequestParam(value = "limitCount", required = false) Integer limitCount, HttpServletResponse response) throws Exception {
Long limitPipelineId = null;
if (limitPipeline != null) {
Pipeline pipeline = pipelineService.findPipelineByCounterOrLabel(pipelineName, limitPipeline);
if (pipeline != null) {
limitPipelineId = pipeline.getId();
} else {
return notFound(String.format("The value [%s] of query parameter 'limitPipeline' is neither a pipeline counter nor label", limitPipeline)).respond(response);
}
}
limitCount = limitCount == null ? 100 : limitCount;
try {
List<Properties> result = propertyService.loadHistory(pipelineName, stageName, jobName, limitPipelineId, limitCount);
PropertiesService.PropertyLister propertyLister = PropertiesService.asCsv(jobName);
return propertyLister.listPropertiesHistory(result).respond(response);
} catch (Exception e) {
String message = String.format("Error on listing properties history for job %s/%s/%s with limitPipeline=%s and limitCount=%s", pipelineName, stageName, jobName, limitPipeline, limitCount);
LOGGER.error(message, e);
return notFound(message + "\n" + e.getMessage()).respond(response);
}
}
use of com.thoughtworks.go.domain.Pipeline in project gocd by gocd.
the class PropertyDaoTest method createPipelineWithJobProperty.
private Pipeline createPipelineWithJobProperty(String pipelineName, Property property) {
Pipeline pipeline = _createPassedPipeline(pipelineName);
propertyDao.save(pipeline.getFirstStage().getJobInstances().first().getId(), property);
return pipeline;
}
use of com.thoughtworks.go.domain.Pipeline in project gocd by gocd.
the class PropertyDaoTest method shouldLoadAllPropertiesHistoryIfLimitPipelineNotSpecified.
@Test
public void shouldLoadAllPropertiesHistoryIfLimitPipelineNotSpecified() throws Exception {
Pipeline oldPipeline = createPipelineWithJobProperty(PIPELINE1, property("key1", "value1"));
Pipeline newPipeline = createPipelineWithJobProperty(PIPELINE1, property("key2", "value2"));
List<Properties> history = propertyDao.loadHistory(PIPELINE1, STAGE1, PLAN1, null, Integer.MAX_VALUE);
assertThat(history.size(), is(2));
}
Aggregations