diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2016-07-29 00:37:35 +0800 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2016-07-29 17:38:53 +0800 |
commit | 755301a2ad1d307c727e3c2642c9e234a7ddb05d (patch) | |
tree | 0c9a2540d52a69bf364694ac8e6056245b098111 | |
parent | 6d82e3f15f8de3bae316cdc2f204b3cdea88b55f (diff) | |
download | gitlab-ce-755301a2ad1d307c727e3c2642c9e234a7ddb05d.tar.gz |
Also touch the pipeline so we could just hook into update_state
-rw-r--r-- | app/models/ci/pipeline.rb | 13 | ||||
-rw-r--r-- | app/services/ci/create_pipeline_service.rb | 1 |
2 files changed, 8 insertions, 6 deletions
diff --git a/app/models/ci/pipeline.rb b/app/models/ci/pipeline.rb index 7d23456cdac..cd6ead4ded2 100644 --- a/app/models/ci/pipeline.rb +++ b/app/models/ci/pipeline.rb @@ -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 diff --git a/app/services/ci/create_pipeline_service.rb b/app/services/ci/create_pipeline_service.rb index be91bf0db85..7a8b0683acb 100644 --- a/app/services/ci/create_pipeline_service.rb +++ b/app/services/ci/create_pipeline_service.rb @@ -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.') |