diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-07-19 14:08:28 +0300 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-07-19 14:08:28 +0300 |
commit | bb8bf6427d80cb4858318a44e395a2d1cd9115b7 (patch) | |
tree | 2b45162a14bca6f233da7c58d523577c1f711fb3 /lib/ci | |
parent | 943ae747eac04e19c2614a5b48f41387c6d150d3 (diff) |
Move job environment validation to new CI config
Diffstat (limited to 'lib/ci')
-rw-r--r-- | lib/ci/gitlab_ci_yaml_processor.rb | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/lib/ci/gitlab_ci_yaml_processor.rb b/lib/ci/gitlab_ci_yaml_processor.rb index 3b6fcd909f4..aa2f7743a5e 100644 --- a/lib/ci/gitlab_ci_yaml_processor.rb +++ b/lib/ci/gitlab_ci_yaml_processor.rb @@ -93,21 +93,10 @@ module Ci def validate_job!(name, job) raise ValidationError, "Unknown parameter: #{name}" unless job.is_a?(Hash) && job.has_key?(:script) - validate_job_types!(name, job) validate_job_stage!(name, job) if job[:stage] validate_job_dependencies!(name, job) if job[:dependencies] end - def validate_job_types!(name, job) - if job[:when] && !job[:when].in?(%w[on_success on_failure always]) - raise ValidationError, "#{name} job: when parameter should be on_success, on_failure or always" - end - - if job[:environment] && !validate_environment(job[:environment]) - raise ValidationError, "#{name} job: environment parameter #{Gitlab::Regex.environment_name_regex_message}" - end - end - def validate_job_stage!(name, job) unless job[:stage].is_a?(String) && job[:stage].in?(@stages) raise ValidationError, "#{name} job: stage parameter should be #{@stages.join(", ")}" |