Commit 755301a2 authored by Lin Jen-Shin's avatar Lin Jen-Shin

Also touch the pipeline so we could just hook into update_state

parent 6d82e3f1
...@@ -213,12 +213,6 @@ module Ci ...@@ -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)
...@@ -244,6 +238,13 @@ module Ci ...@@ -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
......
...@@ -27,6 +27,7 @@ module Ci ...@@ -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.')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment