Welcome to mirror list, hosted at ThFree Co, Russian Federation.

root.rb « header « config « ci « gitlab « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 251682d13b40107e00e3db546c2b92868b77972f (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
26
27
28
29
30
31
32
33
34
35
36
# frozen_string_literal: true

module Gitlab
  module Ci
    class Config
      module Header
        ##
        # This class represents the root entry of the GitLab CI configuration header.
        #
        # A header is the first document in a multi-doc YAML that contains metadata
        # and specifications about the GitLab CI configuration (the second document).
        #
        # The header is optional. A CI configuration can also be represented with a
        # YAML containing a single document.
        class Root < ::Gitlab::Config::Entry::Node
          include ::Gitlab::Config::Entry::Configurable

          ALLOWED_KEYS = %i[spec].freeze

          validations do
            validates :config, type: Hash, allowed_keys: ALLOWED_KEYS
          end

          entry :spec, Header::Spec,
            description: 'Specifications of the CI configuration.',
            inherit: false,
            default: {}

          def inputs_value
            spec_entry.inputs_value
          end
        end
      end
    end
  end
end