Skip to content
Snippets Groups Projects
Commit 755301a2 authored by Lin Jen-Shin's avatar Lin Jen-Shin
Browse files

Also touch the pipeline so we could just hook into update_state

parent 6d82e3f1
No related branches found
No related tags found
1 merge request!5525Implement Slack integration for pipeline hooks
Loading
@@ -213,12 +213,6 @@ module Ci
Loading
@@ -213,12 +213,6 @@ module Ci
] ]
end end
   
def execute_hooks
pipeline_data = Gitlab::DataBuilder::PipelineDataBuilder.build(self)
project.execute_hooks(pipeline_data, :pipeline_hooks)
project.execute_services(pipeline_data.dup, :pipeline_hooks)
end
private private
   
def build_builds_for_stages(stages, user, status, trigger_request) def build_builds_for_stages(stages, user, status, trigger_request)
Loading
@@ -244,6 +238,13 @@ module Ci
Loading
@@ -244,6 +238,13 @@ module Ci
self.finished_at = statuses.finished_at self.finished_at = statuses.finished_at
self.duration = statuses.latest.duration self.duration = statuses.latest.duration
save save
execute_hooks
end
def execute_hooks
pipeline_data = Gitlab::DataBuilder::PipelineDataBuilder.build(self)
project.execute_hooks(pipeline_data, :pipeline_hooks)
project.execute_services(pipeline_data.dup, :pipeline_hooks)
end end
   
def keep_around_commits def keep_around_commits
Loading
Loading
Loading
@@ -27,6 +27,7 @@ module Ci
Loading
@@ -27,6 +27,7 @@ module Ci
end end
   
pipeline.save! pipeline.save!
pipeline.touch
   
unless pipeline.create_builds(current_user) unless pipeline.create_builds(current_user)
pipeline.errors.add(:base, 'No builds for this pipeline.') pipeline.errors.add(:base, 'No builds for this pipeline.')
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment