BigW Consortium Gitlab

config.rb 983 Bytes
Newer Older
1 2
module Gitlab
  module Ci
3 4 5
    ##
    # Base GitLab CI Configuration facade
    #
6 7
    class Config
      def initialize(config)
8
        @config = Loader.new(config).load!
9

10
        @global = Entry::Global.new(@config)
11
        @global.compose!
12 13
      end

14
      def valid?
15
        @global.valid?
16 17 18
      end

      def errors
19
        @global.errors
20 21
      end

22 23 24
      def to_hash
        @config
      end
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59

      ##
      # Temporary method that should be removed after refactoring
      #
      def before_script
        @global.before_script_value
      end

      def image
        @global.image_value
      end

      def services
        @global.services_value
      end

      def after_script
        @global.after_script_value
      end

      def variables
        @global.variables_value
      end

      def stages
        @global.stages_value
      end

      def cache
        @global.cache_value
      end

      def jobs
        @global.jobs_value
      end
60 61 62
    end
  end
end