Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/ci/config/entry/needs.rb')
-rw-r--r--lib/gitlab/ci/config/entry/needs.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/gitlab/ci/config/entry/needs.rb b/lib/gitlab/ci/config/entry/needs.rb
index 11b202ddde9..f0bfad80e6f 100644
--- a/lib/gitlab/ci/config/entry/needs.rb
+++ b/lib/gitlab/ci/config/entry/needs.rb
@@ -21,6 +21,10 @@ module Gitlab
if config.is_a?(Hash) && config.empty?
errors.add(:config, 'can not be an empty Hash')
end
+
+ if number_parallel_build?
+ errors.add(:config, 'cannot use "parallel: <number>".')
+ end
end
validate on: :composed do
@@ -47,6 +51,14 @@ module Gitlab
end
end
+ def number_parallel_build?
+ if config.is_a?(Array)
+ config.any? { |need_values| need_values.is_a?(Hash) && need_values[:parallel].is_a?(Numeric) }
+ elsif config.is_a?(Hash)
+ config[:parallel].is_a?(Numeric)
+ end
+ end
+
def composable_class
Entry::Need
end