Commit 62f115dd authored by Lin Jen-Shin's avatar Lin Jen-Shin

Introduce execute_hooks_unless_ci_skipped

parent 020ea32e
...@@ -18,6 +18,7 @@ module Ci ...@@ -18,6 +18,7 @@ module Ci
# Invalidate object and save if when touched # Invalidate object and save if when touched
after_touch :update_state after_touch :update_state
after_touch :execute_hooks_unless_ci_skipped
after_save :keep_around_commits after_save :keep_around_commits
# ref can't be HEAD or SHA, can only be branch/tag name # ref can't be HEAD or SHA, can only be branch/tag name
...@@ -237,9 +238,11 @@ module Ci ...@@ -237,9 +238,11 @@ module Ci
self.started_at = statuses.started_at self.started_at = statuses.started_at
self.finished_at = statuses.finished_at self.finished_at = statuses.finished_at
self.duration = statuses.latest.duration self.duration = statuses.latest.duration
saved = save save
execute_hooks if saved && !skip_ci? end
saved
def execute_hooks_unless_ci_skipped
execute_hooks unless skip_ci?
end end
def execute_hooks def execute_hooks
......
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