summaryrefslogtreecommitdiff
path: root/app/models/ci
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2016-09-14 19:42:16 +0800
committerLin Jen-Shin <godfat@godfat.org>2016-10-17 07:24:48 +0000
commit8ea702cfe590e94ea496609f85ba0f23bda2dcce (patch)
treeb5aef28ad58ae357b0cdce8651f76710fb69439f /app/models/ci
parent7f7c3e1a8aeba5d21c332c8cacdf8af9067199c4 (diff)
downloadgitlab-ce-8ea702cfe590e94ea496609f85ba0f23bda2dcce.tar.gz
Revert "Split notification integration into another branch"
This reverts commit 1404aa8677969a03ed56e8f8350257f317f576d8.
Diffstat (limited to 'app/models/ci')
-rw-r--r--app/models/ci/pipeline.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/app/models/ci/pipeline.rb b/app/models/ci/pipeline.rb
index 4fdb5fef4fb..c293096f5c9 100644
--- a/app/models/ci/pipeline.rb
+++ b/app/models/ci/pipeline.rb
@@ -82,6 +82,10 @@ module Ci
PipelineHooksWorker.perform_async(id)
end
end
+
+ after_transition any => [:success, :failed] do |pipeline, transition|
+ SendPipelineNotificationService.new(pipeline).execute
+ end
end
# ref can't be HEAD or SHA, can only be branch/tag name
@@ -110,6 +114,11 @@ module Ci
project.id
end
+ # For now the only user who participants is the user who triggered
+ def participants(current_user = nil)
+ [user]
+ end
+
def valid_commit_sha
if self.sha == Gitlab::Git::BLANK_SHA
self.errors.add(:sha, " cant be 00000000 (branch removal)")