From feec3a45eb517607d96f5553f36e7d35c97520ba Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Fri, 1 Apr 2016 10:10:39 +0200 Subject: Show pipelines --- app/models/ci/commit.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'app/models/ci/commit.rb') diff --git a/app/models/ci/commit.rb b/app/models/ci/commit.rb index cd9ce0a283d..45309614115 100644 --- a/app/models/ci/commit.rb +++ b/app/models/ci/commit.rb @@ -67,6 +67,12 @@ module Ci .pluck(:stage, :stage_idx).map(&:first) end + def stages + statuses + .group(:stage, :stage_idx).order(:stage_idx) + .pluck(:stage, :stage_idx).map(&:first) + end + def to_param sha end @@ -115,6 +121,12 @@ module Ci Gitlab::Git::branch_ref?(origin_ref) end + def retryable? + builds.latest.any? do |build| + build.failed? || build.retryable? + end + end + def create_builds(ref, tag, user, trigger_request = nil) return unless config_processor config_processor.stages.any? do |stage| -- cgit v1.2.1