mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-17 16:46:06 +10:00
36 lines
869 B
Ruby
36 lines
869 B
Ruby
module Gitlab
|
|
module Ci
|
|
class Config
|
|
module Node
|
|
##
|
|
# Entry that represents a script.
|
|
#
|
|
# Each element in the value array is a command that will be executed
|
|
# by GitLab Runner. Currently we concatenate these commands with
|
|
# new line character as a separator, what is compatible with
|
|
# implementation in Runner.
|
|
#
|
|
class Script < Entry
|
|
include Validatable
|
|
|
|
validations do
|
|
include ValidationHelpers
|
|
|
|
validate :array_of_strings
|
|
|
|
def array_of_strings
|
|
unless validate_array_of_strings(self.config)
|
|
errors.add(:config, 'should be an array of strings')
|
|
end
|
|
end
|
|
end
|
|
|
|
def value
|
|
@config.join("\n")
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|