summaryrefslogtreecommitdiff
path: root/lib/gitlab/ci/config/entry/image.rb
blob: 10f35a2dbc16c0b13d4ef9aff2884389fd96e302 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
module Gitlab
  module Ci
    class Config
      module Entry
        ##
        # Entry that represents a Docker image.
        #
        class Image < Node
          include Validatable
          include DockerImage

          ALLOWED_KEYS = %i[name entrypoint].freeze

          validations do
            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
          end
        end
      end
    end
  end
end