diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-01-14 21:45:43 +0300 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-01-14 21:45:55 +0300 |
commit | ac652d82f17d378e485dcef15a8fabdcf9bad76b (patch) | |
tree | 722e6afd2ea63a43b15886b890138c3def3d5885 /app/models/ci | |
parent | ba42b03348056e511df8484a8b342c7a2129c4f4 (diff) |
Let the CI runner know about builds that this build depends on
This allows us to implement artifacts passing: runner will download artifacts from all prior builds
Diffstat (limited to 'app/models/ci')
-rw-r--r-- | app/models/ci/build.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb index 6cc26abce66..16a5b03f591 100644 --- a/app/models/ci/build.rb +++ b/app/models/ci/build.rb @@ -128,6 +128,14 @@ module Ci !self.commit.latest_builds_for_ref(self.ref).include?(self) end + def depends_on_builds + # Get builds of the same type + latest_builds = self.commit.builds.similar(self).latest + + # Return builds from previous stages + latest_builds.where('stage_idx < ?', stage_idx) + end + def trace_html html = Ci::Ansi2html::convert(trace) if trace.present? html || '' |