@Test public void deploy() throws Exception { }
@Override public void deploy(PipelineDeployArg pipelineDeployArg) { CreateContainerArg createContainerArg = pipelineDeployArg.getCreateContainerArg(); String comment = pipelineDeployArg.getComment(); String pipelineInstanceId = pipelineDeployArg.getPipelineInstance(); PipelineInstance instance = getPipelineInstance(pipelineInstanceId); PipelineSchema pipelineSchema = getPipelineSchema(instance.getId()); PipelineInstanceHistory history = instance.getOrCreateHistoryByStage(pipelineDeployArg.getStage()); PipelineStageSchema pipelineStages = pipelineSchema.getPipelineStages(pipelineDeployArg.getStage()); history.addComments(comment); Map<String, String> labels = createContainerArg.getContainer().getLabels(); labels.putAll(getRequiredLabels(pipelineSchema, pipelineStages)); labels.put(PIPELINE_ID, pipelineInstanceId); String clusterName = createContainerArg.getContainer().getCluster(); NodesGroup cluster = dockerServiceRegistry.getCluster(clusterName); Assert.notNull(cluster, "Can not find cluster: " + clusterName); cluster.getContainers().createContainer(createContainerArg); pipelineInstances.flush(instance.getId()); riseEvent(pipelineSchema, "deploy"); }
PipelineServiceImpl implements PipelineService { @Override public void deploy(PipelineDeployArg pipelineDeployArg) { CreateContainerArg createContainerArg = pipelineDeployArg.getCreateContainerArg(); String comment = pipelineDeployArg.getComment(); String pipelineInstanceId = pipelineDeployArg.getPipelineInstance(); PipelineInstance instance = getPipelineInstance(pipelineInstanceId); PipelineSchema pipelineSchema = getPipelineSchema(instance.getId()); PipelineInstanceHistory history = instance.getOrCreateHistoryByStage(pipelineDeployArg.getStage()); PipelineStageSchema pipelineStages = pipelineSchema.getPipelineStages(pipelineDeployArg.getStage()); history.addComments(comment); Map<String, String> labels = createContainerArg.getContainer().getLabels(); labels.putAll(getRequiredLabels(pipelineSchema, pipelineStages)); labels.put(PIPELINE_ID, pipelineInstanceId); String clusterName = createContainerArg.getContainer().getCluster(); NodesGroup cluster = dockerServiceRegistry.getCluster(clusterName); Assert.notNull(cluster, "Can not find cluster: " + clusterName); cluster.getContainers().createContainer(createContainerArg); pipelineInstances.flush(instance.getId()); riseEvent(pipelineSchema, "deploy"); } }
PipelineServiceImpl implements PipelineService { @Override public void deploy(PipelineDeployArg pipelineDeployArg) { CreateContainerArg createContainerArg = pipelineDeployArg.getCreateContainerArg(); String comment = pipelineDeployArg.getComment(); String pipelineInstanceId = pipelineDeployArg.getPipelineInstance(); PipelineInstance instance = getPipelineInstance(pipelineInstanceId); PipelineSchema pipelineSchema = getPipelineSchema(instance.getId()); PipelineInstanceHistory history = instance.getOrCreateHistoryByStage(pipelineDeployArg.getStage()); PipelineStageSchema pipelineStages = pipelineSchema.getPipelineStages(pipelineDeployArg.getStage()); history.addComments(comment); Map<String, String> labels = createContainerArg.getContainer().getLabels(); labels.putAll(getRequiredLabels(pipelineSchema, pipelineStages)); labels.put(PIPELINE_ID, pipelineInstanceId); String clusterName = createContainerArg.getContainer().getCluster(); NodesGroup cluster = dockerServiceRegistry.getCluster(clusterName); Assert.notNull(cluster, "Can not find cluster: " + clusterName); cluster.getContainers().createContainer(createContainerArg); pipelineInstances.flush(instance.getId()); riseEvent(pipelineSchema, "deploy"); } @Autowired  PipelineServiceImpl(KvMapperFactory kvmf,
                               DiscoveryStorage dockerServiceRegistry,
                               RegistryRepository registryRepository,
                               @Qualifier(PipelineEvent.BUS) MessageBus<PipelineEvent> pipelineEventBus,
                               JobsManager jobsManager,
                               @Value("${dm.pipeline.updateCronExpression:* * * * * *}") String updateCronExpression); }
PipelineServiceImpl implements PipelineService { @Override public void deploy(PipelineDeployArg pipelineDeployArg) { CreateContainerArg createContainerArg = pipelineDeployArg.getCreateContainerArg(); String comment = pipelineDeployArg.getComment(); String pipelineInstanceId = pipelineDeployArg.getPipelineInstance(); PipelineInstance instance = getPipelineInstance(pipelineInstanceId); PipelineSchema pipelineSchema = getPipelineSchema(instance.getId()); PipelineInstanceHistory history = instance.getOrCreateHistoryByStage(pipelineDeployArg.getStage()); PipelineStageSchema pipelineStages = pipelineSchema.getPipelineStages(pipelineDeployArg.getStage()); history.addComments(comment); Map<String, String> labels = createContainerArg.getContainer().getLabels(); labels.putAll(getRequiredLabels(pipelineSchema, pipelineStages)); labels.put(PIPELINE_ID, pipelineInstanceId); String clusterName = createContainerArg.getContainer().getCluster(); NodesGroup cluster = dockerServiceRegistry.getCluster(clusterName); Assert.notNull(cluster, "Can not find cluster: " + clusterName); cluster.getContainers().createContainer(createContainerArg); pipelineInstances.flush(instance.getId()); riseEvent(pipelineSchema, "deploy"); } @Autowired  PipelineServiceImpl(KvMapperFactory kvmf,
                               DiscoveryStorage dockerServiceRegistry,
                               RegistryRepository registryRepository,
                               @Qualifier(PipelineEvent.BUS) MessageBus<PipelineEvent> pipelineEventBus,
                               JobsManager jobsManager,
                               @Value("${dm.pipeline.updateCronExpression:* * * * * *}") String updateCronExpression); @PostConstruct void initialize(); @Override void getOrUpdatePipeline(PipelineSchemaArg arg); @Scheduled(fixedDelay = Long.MAX_VALUE, initialDelay = 60_000) void load(); PipelineInstance createPipelineInstance(String id,
                                                   String name,
                                                   PipelineSchema pipelineSchema,
                                                   PipelineStageSchema pipelineStageName); @Override void promote(PipelinePromoteArg pipelinePromoteArg); @Override void deploy(PipelineDeployArg pipelineDeployArg); @Override void deletePipeline(String pipelineName); @Override void deleteInstance(String pipelineName); @Override Map<String, PipelineSchema> getPipelinesMap(); @Override PipelineSchema getPipeline(String pipelineId); @Override Map<String, PipelineInstance> getInstancesMap(); @Override PipelineInstance getInstance(String pipelineInstanceId); @Override Map<String, PipelineInstance> getInstancesMapByPipeline(String pipelineId); PipelineInstance getPipelineInstance(String id); PipelineSchema getPipelineSchema(String id); }
PipelineServiceImpl implements PipelineService { @Override public void deploy(PipelineDeployArg pipelineDeployArg) { CreateContainerArg createContainerArg = pipelineDeployArg.getCreateContainerArg(); String comment = pipelineDeployArg.getComment(); String pipelineInstanceId = pipelineDeployArg.getPipelineInstance(); PipelineInstance instance = getPipelineInstance(pipelineInstanceId); PipelineSchema pipelineSchema = getPipelineSchema(instance.getId()); PipelineInstanceHistory history = instance.getOrCreateHistoryByStage(pipelineDeployArg.getStage()); PipelineStageSchema pipelineStages = pipelineSchema.getPipelineStages(pipelineDeployArg.getStage()); history.addComments(comment); Map<String, String> labels = createContainerArg.getContainer().getLabels(); labels.putAll(getRequiredLabels(pipelineSchema, pipelineStages)); labels.put(PIPELINE_ID, pipelineInstanceId); String clusterName = createContainerArg.getContainer().getCluster(); NodesGroup cluster = dockerServiceRegistry.getCluster(clusterName); Assert.notNull(cluster, "Can not find cluster: " + clusterName); cluster.getContainers().createContainer(createContainerArg); pipelineInstances.flush(instance.getId()); riseEvent(pipelineSchema, "deploy"); } @Autowired  PipelineServiceImpl(KvMapperFactory kvmf,
                               DiscoveryStorage dockerServiceRegistry,
                               RegistryRepository registryRepository,
                               @Qualifier(PipelineEvent.BUS) MessageBus<PipelineEvent> pipelineEventBus,
                               JobsManager jobsManager,
                               @Value("${dm.pipeline.updateCronExpression:* * * * * *}") String updateCronExpression); @PostConstruct void initialize(); @Override void getOrUpdatePipeline(PipelineSchemaArg arg); @Scheduled(fixedDelay = Long.MAX_VALUE, initialDelay = 60_000) void load(); PipelineInstance createPipelineInstance(String id,
                                                   String name,
                                                   PipelineSchema pipelineSchema,
                                                   PipelineStageSchema pipelineStageName); @Override void promote(PipelinePromoteArg pipelinePromoteArg); @Override void deploy(PipelineDeployArg pipelineDeployArg); @Override void deletePipeline(String pipelineName); @Override void deleteInstance(String pipelineName); @Override Map<String, PipelineSchema> getPipelinesMap(); @Override PipelineSchema getPipeline(String pipelineId); @Override Map<String, PipelineInstance> getInstancesMap(); @Override PipelineInstance getInstance(String pipelineInstanceId); @Override Map<String, PipelineInstance> getInstancesMapByPipeline(String pipelineId); PipelineInstance getPipelineInstance(String id); PipelineSchema getPipelineSchema(String id);  }