diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-07-14 16:01:18 +0200 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-07-14 16:01:18 +0200 |
commit | 615c9730e7783e82287d2b65f58da6336d3d2410 (patch) | |
tree | efad73485421b53c0b40408838ed45ad6b2f09ce /lib | |
parent | 5923741fe690a688591ad36da894b3103954a437 (diff) | |
download | gitlab-ce-615c9730e7783e82287d2b65f58da6336d3d2410.tar.gz |
Remove job cache configfrom legacy yaml processor
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ci/gitlab_ci_yaml_processor.rb | 21 | ||||
-rw-r--r-- | lib/gitlab/ci/config/node/job.rb | 6 |
2 files changed, 5 insertions, 22 deletions
diff --git a/lib/ci/gitlab_ci_yaml_processor.rb b/lib/ci/gitlab_ci_yaml_processor.rb index 0217a905eac..3e4767cc9f6 100644 --- a/lib/ci/gitlab_ci_yaml_processor.rb +++ b/lib/ci/gitlab_ci_yaml_processor.rb @@ -107,7 +107,6 @@ module Ci validate_job_stage!(name, job) if job[:stage] validate_job_variables!(name, job) if job[:variables] - validate_job_cache!(name, job) if job[:cache] validate_job_artifacts!(name, job) if job[:artifacts] validate_job_dependencies!(name, job) if job[:dependencies] end @@ -167,26 +166,6 @@ module Ci end end - def validate_job_cache!(name, job) - job[:cache].keys.each do |key| - unless ALLOWED_CACHE_KEYS.include? key - raise ValidationError, "#{name} job: cache unknown parameter #{key}" - end - end - - if job[:cache][:key] && !validate_string(job[:cache][:key]) - raise ValidationError, "#{name} job: cache:key parameter should be a string" - end - - if job[:cache][:untracked] && !validate_boolean(job[:cache][:untracked]) - raise ValidationError, "#{name} job: cache:untracked parameter should be an boolean" - end - - if job[:cache][:paths] && !validate_array_of_strings(job[:cache][:paths]) - raise ValidationError, "#{name} job: cache:paths parameter should be an array of strings" - end - end - def validate_job_artifacts!(name, job) job[:artifacts].keys.each do |key| unless ALLOWED_ARTIFACTS_KEYS.include? key diff --git a/lib/gitlab/ci/config/node/job.rb b/lib/gitlab/ci/config/node/job.rb index cca9791fc8e..483be2a21cc 100644 --- a/lib/gitlab/ci/config/node/job.rb +++ b/lib/gitlab/ci/config/node/job.rb @@ -32,7 +32,10 @@ module Gitlab node :after_script, Script, description: 'Commands that will be executed when finishing job.' - helpers :before_script, :script, :stage, :type, :after_script + node :cache, Cache, + description: 'Cache definition for this job.' + + helpers :before_script, :script, :stage, :type, :after_script, :cache def name @key @@ -48,6 +51,7 @@ module Gitlab { before_script: before_script_value, script: script_value, stage: stage_value, + cache: cache_value, after_script: after_script_value } end |