Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib/ci
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-06-29 10:49:46 +0300
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-06-29 10:49:46 +0300
commit7759242ae5da221ebe02e9e4b79be3e6aadc9bc6 (patch)
tree9dd691c19b0c79da49130889bb1f3d1515dd5716 /lib/ci
parentf4421817de474cda3598eac8cad0752d324608e1 (diff)
Move global CI cache configuration to new CI classes
Diffstat (limited to 'lib/ci')
-rw-r--r--lib/ci/gitlab_ci_yaml_processor.rb30
1 files changed, 2 insertions, 28 deletions
diff --git a/lib/ci/gitlab_ci_yaml_processor.rb b/lib/ci/gitlab_ci_yaml_processor.rb
index 33492775fe1..01ef13df57a 100644
--- a/lib/ci/gitlab_ci_yaml_processor.rb
+++ b/lib/ci/gitlab_ci_yaml_processor.rb
@@ -13,7 +13,7 @@ module Ci
ALLOWED_CACHE_KEYS = [:key, :untracked, :paths]
ALLOWED_ARTIFACTS_KEYS = [:name, :untracked, :paths, :when, :expire_in]
- attr_reader :path, :cache
+ attr_reader :path, :cache, :stages
def initialize(config, path = nil)
@ci_config = Gitlab::Ci::Config.new(config)
@@ -44,10 +44,6 @@ module Ci
end
end
- def stages
- @stages
- end
-
def global_variables
@variables
end
@@ -68,8 +64,8 @@ module Ci
@services = @ci_config.services
@variables = @ci_config.variables
@stages = @ci_config.stages
+ @cache = @ci_config.cache
- @cache = @config[:cache]
@jobs = {}
@config.except!(*ALLOWED_YAML_KEYS)
@@ -116,8 +112,6 @@ module Ci
end
def validate!
- validate_global_cache! if @cache
-
@jobs.each do |name, job|
validate_job!(name, job)
end
@@ -125,26 +119,6 @@ module Ci
true
end
- def validate_global_cache!
- @cache.keys.each do |key|
- unless ALLOWED_CACHE_KEYS.include?(key)
- raise ValidationError, "Cache config has unknown parameter: #{key}"
- end
- end
-
- if @cache[:key] && !validate_string(@cache[:key])
- raise ValidationError, "cache:key parameter should be a string"
- end
-
- if @cache[:untracked] && !validate_boolean(@cache[:untracked])
- raise ValidationError, "cache:untracked parameter should be an boolean"
- end
-
- if @cache[:paths] && !validate_array_of_strings(@cache[:paths])
- raise ValidationError, "cache:paths parameter should be an array of strings"
- end
- end
-
def validate_job!(name, job)
validate_job_name!(name)
validate_job_keys!(name, job)