image.rb 585 字节
Newer Older
1 2 3
module Gitlab
  module Ci
    class Config
4
      module Entry
5 6 7
        ##
        # Entry that represents a Docker image.
        #
8
        class Image < Node
9
          include Validatable
10 11 12
          include DockerImage

          ALLOWED_KEYS = %i[name entrypoint].freeze
13 14

          validations do
15 16 17 18 19
            validates :config, hash_or_string: true
            validates :config, allowed_keys: ALLOWED_KEYS

            validates :name, type: String, presence: true
            validates :entrypoint, type: String, allow_nil: true
20 21 22 23 24 25
          end
        end
      end
    end
  end
end