diff options
Diffstat (limited to 'app/models/ci/processable.rb')
-rw-r--r-- | app/models/ci/processable.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/app/models/ci/processable.rb b/app/models/ci/processable.rb index ac5785d9c91..6aaf6ac530b 100644 --- a/app/models/ci/processable.rb +++ b/app/models/ci/processable.rb @@ -103,5 +103,25 @@ module Ci pipeline.ensure_scheduling_type! reset end + + def dependency_variables + return [] if all_dependencies.empty? + + Gitlab::Ci::Variables::Collection.new.concat( + Ci::JobVariable.where(job: all_dependencies).dotenv_source + ) + end + + def all_dependencies + dependencies.all + end + + private + + def dependencies + strong_memoize(:dependencies) do + Ci::BuildDependencies.new(self) + end + end end end |