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
|
|
|
|
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-11-14 04:31:45 -05:00
|
|
|
@global = Entry::Global.new(@config)
|
2016-08-25 07:49:15 -04:00
|
|
|
@global.compose!
|
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
|
2016-11-18 08:30:27 -05:00
|
|
|
|
|
|
|
##
|
|
|
|
# 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
|
2016-06-03 08:20:34 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|