Skip to content

Commit

Permalink
feat(tasks): attach notifications to execution (#3206)
Browse files Browse the repository at this point in the history
  • Loading branch information
emjburns committed Oct 2, 2019
1 parent ef3c8c6 commit 823ca2e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,11 @@ private Execution parseOrchestration(String configJson) throws IOException {
}

if (config.get("trigger") != null) {
orchestration.setTrigger(objectMapper.convertValue(config.get("trigger"), Trigger.class));
Trigger trigger = objectMapper.convertValue(config.get("trigger"), Trigger.class);
orchestration.setTrigger(trigger);
if (!trigger.getNotifications().isEmpty()) {
orchestration.setNotifications(trigger.getNotifications());
}
}

orchestration.setBuildTime(clock.millis());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,12 +286,16 @@ public void setSource(@Nullable PipelineSource source) {
this.source = source;
}

private final List<Map<String, Object>> notifications = new ArrayList<>();
private List<Map<String, Object>> notifications = new ArrayList<>();

public @Nonnull List<Map<String, Object>> getNotifications() {
return notifications;
}

public void setNotifications(List<Map<String, Object>> notifications) {
this.notifications = notifications;
}

private final Map<String, Object> initialConfig = new HashMap<>();

public @Nonnull Map<String, Object> getInitialConfig() {
Expand Down

0 comments on commit 823ca2e

Please sign in to comment.