diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2016-08-03 14:35:11 +0800 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2016-08-03 14:35:41 +0800 |
commit | 62f115dd25c4d3639dceac1b3b81c9fe42eeedd3 (patch) | |
tree | c24bc1d82959b83943cf2e106b95a0fb3afaaa9c | |
parent | 020ea32e767b9ad033f9fedcaa902865a01fa944 (diff) | |
download | gitlab-ce-62f115dd25c4d3639dceac1b3b81c9fe42eeedd3.tar.gz |
Introduce execute_hooks_unless_ci_skipped
-rw-r--r-- | app/models/ci/pipeline.rb | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/app/models/ci/pipeline.rb b/app/models/ci/pipeline.rb index 4e6ccf48c68..f8506e33295 100644 --- a/app/models/ci/pipeline.rb +++ b/app/models/ci/pipeline.rb @@ -18,6 +18,7 @@ module Ci # Invalidate object and save if when touched after_touch :update_state + after_touch :execute_hooks_unless_ci_skipped after_save :keep_around_commits # ref can't be HEAD or SHA, can only be branch/tag name @@ -237,9 +238,11 @@ module Ci self.started_at = statuses.started_at self.finished_at = statuses.finished_at self.duration = statuses.latest.duration - saved = save - execute_hooks if saved && !skip_ci? - saved + save + end + + def execute_hooks_unless_ci_skipped + execute_hooks unless skip_ci? end def execute_hooks |