diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-05-10 02:26:13 +0300 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-05-10 02:26:13 +0300 |
commit | fe2137d871b978033007a3375cf6f1edf0f04cd4 (patch) | |
tree | e75b2aca3150efd6433314fb57e10c6ba763db6e /app/models/ci/commit.rb | |
parent | 504a1fac95a2af2cf90f00f310d244d8d37f0015 (diff) | |
download | gitlab-ce-fe2137d871b978033007a3375cf6f1edf0f04cd4.tar.gz |
Improve pipelines design
Diffstat (limited to 'app/models/ci/commit.rb')
-rw-r--r-- | app/models/ci/commit.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/models/ci/commit.rb b/app/models/ci/commit.rb index 759c31b0055..71696a3923c 100644 --- a/app/models/ci/commit.rb +++ b/app/models/ci/commit.rb @@ -89,6 +89,14 @@ module Ci end end + def cancel_running + builds.running_or_pending.each(&:cancel) + end + + def retry_failed + builds.latest.failed.select(&:retryable?).each(&:retry) + end + def latest? return false unless ref commit = project.commit(ref) |