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.
|
|
|
|
#
|
2017-08-17 22:00:37 +05:30
|
|
|
class Commands < Node
|
2016-09-13 17:45:13 +05:30
|
|
|
include Validatable
|
|
|
|
|
|
|
|
validations do
|
|
|
|
include LegacyValidationHelpers
|
|
|
|
|
|
|
|
validate do
|
|
|
|
unless string_or_array_of_strings?(config)
|
|
|
|
errors.add(:config,
|
|
|
|
'should be a string or an array of strings')
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def string_or_array_of_strings?(field)
|
|
|
|
validate_string(field) || validate_array_of_strings(field)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def value
|
|
|
|
Array(@config)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|