diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-07-14 15:23:52 +0200 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-07-14 15:45:07 +0200 |
commit | 3e16b015b969a4d5d28240e76bffd382b0772f49 (patch) | |
tree | 720ec13b11b4a55205f4335da0b79b75890243a7 /lib/ci/gitlab_ci_yaml_processor.rb | |
parent | f7c80e9f31944c0001c9bef23d1a8efe33e4adce (diff) | |
download | gitlab-ce-3e16b015b969a4d5d28240e76bffd382b0772f49.tar.gz |
Revert logical validation in CI job stage entry
Diffstat (limited to 'lib/ci/gitlab_ci_yaml_processor.rb')
-rw-r--r-- | lib/ci/gitlab_ci_yaml_processor.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/ci/gitlab_ci_yaml_processor.rb b/lib/ci/gitlab_ci_yaml_processor.rb index 144f9cd7b74..0217a905eac 100644 --- a/lib/ci/gitlab_ci_yaml_processor.rb +++ b/lib/ci/gitlab_ci_yaml_processor.rb @@ -105,6 +105,7 @@ module Ci validate_job_keys!(name, job) validate_job_types!(name, job) + 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] @@ -153,6 +154,12 @@ module Ci 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(", ")}" + end + end + def validate_job_variables!(name, job) unless validate_variables(job[:variables]) raise ValidationError, |