2016-06-16 23:09:34 +05:30
|
|
|
module Gitlab
|
|
|
|
module Ci
|
|
|
|
##
|
|
|
|
# Base GitLab CI Configuration facade
|
|
|
|
#
|
|
|
|
class Config
|
|
|
|
def initialize(config)
|
|
|
|
@config = Loader.new(config).load!
|
|
|
|
|
2017-08-17 22:00:37 +05:30
|
|
|
@global = Entry::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
|
2017-08-17 22:00:37 +05:30
|
|
|
|
|
|
|
##
|
|
|
|
# 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-16 23:09:34 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|