예제 #1
0
 public PipelineConfig addPipeline(
     String pipelineName,
     String stageName,
     MaterialConfig materialConfig,
     TrackingTool trackingTool,
     String... jobs) {
   CruiseConfig cruiseConfig = loadForEdit();
   PipelineConfig pipelineConfig =
       goConfigMother.addPipeline(
           cruiseConfig, pipelineName, stageName, new MaterialConfigs(materialConfig), jobs);
   pipelineConfig.setTrackingTool(trackingTool);
   writeConfigFile(cruiseConfig);
   return pipelineConfig;
 }
예제 #2
0
 public PipelineConfig addPipelineWithGroup(
     String groupName,
     String pipelineName,
     MaterialConfigs materialConfigs,
     TrackingTool trackingTool,
     String stageName,
     String... jobs) {
   CruiseConfig cruiseConfig = loadForEdit();
   PipelineConfig pipelineConfig =
       goConfigMother.addPipelineWithGroup(
           cruiseConfig, groupName, pipelineName, materialConfigs, stageName, jobs);
   pipelineConfig.setTrackingTool(trackingTool);
   writeConfigFile(cruiseConfig);
   return pipelineConfig;
 }
예제 #3
0
  public PipelineConfig toPipelineConfig(CRPipeline crPipeline) {
    MaterialConfigs materialConfigs = new MaterialConfigs();
    for (CRMaterial crMaterial : crPipeline.getMaterials()) {
      materialConfigs.add(toMaterialConfig(crMaterial));
    }

    PipelineConfig pipelineConfig =
        new PipelineConfig(new CaseInsensitiveString(crPipeline.getName()), materialConfigs);

    for (CRStage crStage : crPipeline.getStages()) {
      pipelineConfig.add(toStage(crStage));
    }

    if (crPipeline.getLabelTemplate() != null)
      pipelineConfig.setLabelTemplate(crPipeline.getLabelTemplate());

    CRTrackingTool crTrackingTool = crPipeline.getTrackingTool();
    if (crTrackingTool != null) {
      pipelineConfig.setTrackingTool(toTrackingTool(crTrackingTool));
    }
    CRMingle crMingle = crPipeline.getMingle();
    if (crMingle != null) {
      pipelineConfig.setMingleConfig(toMingleConfig(crMingle));
    }

    CRTimer crTimer = crPipeline.getTimer();
    if (crTimer != null) {
      pipelineConfig.setTimer(toTimerConfig(crTimer));
    }

    EnvironmentVariablesConfig variables = pipelineConfig.getVariables();
    for (CREnvironmentVariable crEnvironmentVariable : crPipeline.getEnvironmentVariables()) {
      variables.add(toEnvironmentVariableConfig(crEnvironmentVariable));
    }

    pipelineConfig.setLock(crPipeline.isLocked());

    return pipelineConfig;
  }