gitlab-org--gitlab-foss/lib/gitlab/ci/config/node/script.rb

30 lines
736 B
Ruby
Raw Normal View History

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 this commands with
# new line character as a separator what is compatbile with
# implementation in Runner.
#
class Script < Entry
include ValidationHelpers
def value
@value.join("\n")
end
def validate!
unless validate_array_of_strings(@value)
@errors << 'before_script should be an array of strings'
end
end
end
end
end
end
end