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