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
]
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
def build_builds_for_stages(stages, user, status, trigger_request)
......@@ -244,6 +238,13 @@ module Ci
self.finished_at = statuses.finished_at
self.duration = statuses.latest.duration
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
def keep_around_commits
......
......@@ -27,6 +27,7 @@ module Ci
end
pipeline.save!
pipeline.touch
unless pipeline.create_builds(current_user)
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