2016-06-03 08:20:34 -04:00
|
|
|
module Gitlab
|
|
|
|
module Ci
|
2016-06-09 07:01:19 -04:00
|
|
|
##
|
|
|
|
# Base GitLab CI Configuration facade
|
|
|
|
#
|
2016-06-03 08:20:34 -04:00
|
|
|
class Config
|
2016-06-07 08:23:47 -04:00
|
|
|
##
|
|
|
|
# Temporary delegations that should be removed after refactoring
|
|
|
|
#
|
2016-06-22 05:22:53 -04:00
|
|
|
delegate :before_script, :image, :services, :after_script, :variables,
|
2016-06-29 03:49:46 -04:00
|
|
|
:stages, :cache, to: :@global
|
2016-06-07 08:23:47 -04:00
|
|
|
|
2016-06-03 08:20:34 -04:00
|
|
|
def initialize(config)
|
2016-06-08 05:38:56 -04:00
|
|
|
@config = Loader.new(config).load!
|
2016-06-03 08:20:34 -04:00
|
|
|
|
2016-06-07 06:13:22 -04:00
|
|
|
@global = Node::Global.new(@config)
|
2016-06-06 06:23:27 -04:00
|
|
|
@global.process!
|
2016-06-03 08:20:34 -04:00
|
|
|
end
|
|
|
|
|
2016-06-09 08:48:40 -04:00
|
|
|
def valid?
|
2016-06-16 08:16:33 -04:00
|
|
|
@global.valid?
|
2016-06-09 08:48:40 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
def errors
|
2016-06-16 08:16:33 -04:00
|
|
|
@global.errors
|
2016-06-09 08:48:40 -04:00
|
|
|
end
|
|
|
|
|
2016-06-03 08:20:34 -04:00
|
|
|
def to_hash
|
|
|
|
@config
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|