2016-06-16 23:09:34 +05:30
|
|
|
module Gitlab
|
|
|
|
module Ci
|
|
|
|
##
|
|
|
|
# Base GitLab CI Configuration facade
|
|
|
|
#
|
|
|
|
class Config
|
|
|
|
##
|
|
|
|
# Temporary delegations that should be removed after refactoring
|
|
|
|
#
|
2016-08-24 12:49:21 +05:30
|
|
|
delegate :before_script, :image, :services, :after_script, :variables,
|
2016-09-13 17:45:13 +05:30
|
|
|
:stages, :cache, :jobs, to: :@global
|
2016-06-16 23:09:34 +05:30
|
|
|
|
|
|
|
def initialize(config)
|
|
|
|
@config = Loader.new(config).load!
|
|
|
|
|
|
|
|
@global = Node::Global.new(@config)
|
2016-09-29 09:46:39 +05:30
|
|
|
@global.compose!
|
2016-06-16 23:09:34 +05:30
|
|
|
end
|
|
|
|
|
2016-08-24 12:49:21 +05:30
|
|
|
def valid?
|
|
|
|
@global.valid?
|
|
|
|
end
|
|
|
|
|
|
|
|
def errors
|
|
|
|
@global.errors
|
|
|
|
end
|
|
|
|
|
2016-06-16 23:09:34 +05:30
|
|
|
def to_hash
|
|
|
|
@config
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|