Skip to content

Commit

Permalink
Merge pull request #259 from anotherchrisberry/adhoc-notifications
Browse files Browse the repository at this point in the history
allow users to send additional notifications when triggering pipelines
  • Loading branch information
anotherchrisberry authored Jul 20, 2016
2 parents 1f6b96b + 71cc36a commit 0a39cf4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ class PipelineController {
@RequestBody(required = false) Map trigger) {
trigger = trigger ?: [:]
trigger.user = trigger.user ?: AuthenticatedRequest.getSpinnakerUser().orElse('anonymous')
trigger.notifications = trigger.notifications ?: [];

try {
def body = pipelineService.trigger(application, pipelineNameOrId, trigger)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,13 @@ class PipelineService {
throw new PipelineConfigNotFoundException()
}
pipelineConfig.trigger = trigger
if (trigger.notifications) {
if (pipelineConfig.notifications) {
((List) pipelineConfig.notifications).addAll(trigger.notifications)
} else {
pipelineConfig.notifications = trigger.notifications;
}
}
orcaService.startPipeline(pipelineConfig, trigger.user?.toString())
}

Expand Down

0 comments on commit 0a39cf4

Please sign in to comment.