com.netflix.spinnaker.orca.pipeline.model.Stage.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(3.9k)|赞(0)|评价(0)|浏览(90)

本文整理了Java中com.netflix.spinnaker.orca.pipeline.model.Stage.<init>()方法的一些代码示例,展示了Stage.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Stage.<init>()方法的具体详情如下:
包路径:com.netflix.spinnaker.orca.pipeline.model.Stage
类名称:Stage
方法名:<init>

Stage.<init>介绍

暂无

代码示例

代码示例来源:origin: spinnaker/kayenta

@Test
public void test_that_getRunCanaryStages_returns_the_expected_sorted_list_of_stages_sorted_by_the_number_in_the_stage_name() {
 Stage stage = mock(Stage.class);
 Execution execution = mock(Execution.class);
 when(stage.getExecution()).thenReturn(execution);
 when(execution.getStages()).thenReturn(ImmutableList.of(
   new Stage(null, STAGE_TYPE, "foo #1", Maps.newHashMap(ImmutableMap.of("index", "0"))),
   new Stage(null, STAGE_TYPE, "foo #3", Maps.newHashMap(ImmutableMap.of("index", "2"))),
   new Stage(null, STAGE_TYPE, "foo #2", Maps.newHashMap(ImmutableMap.of("index", "1"))),
   new Stage(null, STAGE_TYPE, "foo #4", Maps.newHashMap(ImmutableMap.of("index", "3")))
 ));
 List<Stage> actual = task.getRunCanaryStages(stage);
 for (int i = 0; i < 4; i++) {
  assertEquals(String.valueOf(i), actual.get(i).getContext().get("index"));
 }
}

代码示例来源:origin: com.netflix.spinnaker.orca/orca-core

private Stage newStage(Consumer<Stage> init) {
  Stage stage = new Stage();
  init.accept(stage);
  return stage;
 }
}

代码示例来源:origin: com.netflix.spinnaker.orca/orca-core

public PipelineBuilder withStage(String type, String name, Map<String, Object> context) {
 if (context.get("providerType") != null && !(Arrays.asList("aws", "titus")).contains(context.get("providerType"))) {
  type += "_" + context.get("providerType");
 }
 pipeline.getStages().add(new Stage(pipeline, type, name, context));
 return this;
}

代码示例来源:origin: com.netflix.spinnaker.orca/orca-core

@Deprecated
static @Nonnull Stage newStage(
 @Nonnull Execution execution,
 @Nonnull String type,
 @Nullable String name,
 @Nonnull Map<String, Object> context,
 @Nullable Stage parent,
 @Nullable SyntheticStageOwner stageOwner
) {
 Stage stage = new Stage(execution, type, name, context);
 if (parent != null) {
  stage.setParentStageId(parent.getId());
 }
 stage.setSyntheticStageOwner(stageOwner);
 return stage;
}

代码示例来源:origin: com.netflix.spinnaker.orca/orca-core

private Execution parseOrchestration(String configJson) throws IOException {
 @SuppressWarnings("unchecked")
 Map<String, Serializable> config = objectMapper.readValue(configJson, Map.class);
 Execution orchestration = Execution.newOrchestration(getString(config, "application"));
 if (config.containsKey("name")) {
  orchestration.setDescription(getString(config, "name"));
 }
 if (config.containsKey("description")) {
  orchestration.setDescription(getString(config, "description"));
 }
 for (Map<String, Object> context : getList(config, "stages")) {
  String type = context.remove("type").toString();
  String providerType = getString(context, "providerType");
  if (providerType != null && !providerType.equals("aws") && !providerType.equals("titus")) {
   type += format("_%s", providerType);
  }
  // TODO: need to check it's valid?
  Stage stage = new Stage(orchestration, type, context);
  orchestration.getStages().add(stage);
 }
 if (config.get("trigger") != null) {
  orchestration.setTrigger(objectMapper.convertValue(config.get("trigger"), Trigger.class));
 }
 orchestration.setBuildTime(clock.millis());
 orchestration.setAuthentication(AuthenticationDetails.build().orElse(new AuthenticationDetails()));
 orchestration.setOrigin((String) config.getOrDefault("origin", "unknown"));
 orchestration.setStartTimeExpiry((Long) config.get("startTimeExpiry"));
 return orchestration;
}

代码示例来源:origin: com.netflix.spinnaker.orca/orca-redis

stageIds.forEach(stageId -> {
 String prefix = format("stage.%s.", stageId);
 Stage stage = new Stage();
 try {
  stage.setId(stageId);

相关文章