com.netflix.spinnaker.orca.pipeline.model.Execution.setTrigger()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(2.5k)|赞(0)|评价(0)|浏览(98)

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

Execution.setTrigger介绍

暂无

代码示例

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

public PipelineBuilder withTrigger(Trigger trigger) {
 if (trigger != null) {
  pipeline.setTrigger(trigger);
 }
 return this;
}

代码示例来源: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

execution.setSource(mapper.readValue(map.get("source"), Execution.PipelineSource.class));
execution.setTrigger(map.get("trigger") != null ? mapper.readValue(map.get("trigger"), Trigger.class) : NO_TRIGGER);
if (map.get("systemNotifications") != null) {
 execution.getSystemNotifications().addAll(mapper.readValue(map.get("systemNotifications"), LIST_OF_SYSTEM_NOTIFICATIONS));

相关文章