debian-mirror-gitlab/lib/gitlab/ci/config/entry/commands.rb

27 lines
572 B
Ruby
Raw Normal View History

2018-12-13 13:39:08 +05:30
# frozen_string_literal: true
2016-09-13 17:45:13 +05:30
module Gitlab
module Ci
class Config
2017-08-17 22:00:37 +05:30
module Entry
2016-09-13 17:45:13 +05:30
##
# Entry that represents a job script.
#
2019-02-15 15:39:39 +05:30
class Commands < ::Gitlab::Config::Entry::Node
include ::Gitlab::Config::Entry::Validatable
2016-09-13 17:45:13 +05:30
2021-03-11 19:13:27 +05:30
MAX_NESTING_LEVEL = 10
2016-09-13 17:45:13 +05:30
validations do
2021-03-11 19:13:27 +05:30
validates :config, string_or_nested_array_of_strings: { max_level: MAX_NESTING_LEVEL }
2016-09-13 17:45:13 +05:30
end
def value
2021-03-11 19:13:27 +05:30
Array(@config).flatten(MAX_NESTING_LEVEL)
2016-09-13 17:45:13 +05:30
end
end
end
end
end
end