From 036e297ca3c39f90aebc76d5acb2e01f32364d0d Mon Sep 17 00:00:00 2001 From: Grzegorz Bizon Date: Wed, 13 Jul 2016 15:04:12 +0200 Subject: Expose CI job commands and use in legacy processor --- lib/ci/gitlab_ci_yaml_processor.rb | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'lib/ci') diff --git a/lib/ci/gitlab_ci_yaml_processor.rb b/lib/ci/gitlab_ci_yaml_processor.rb index ed8dd0f9e47..61075d3b923 100644 --- a/lib/ci/gitlab_ci_yaml_processor.rb +++ b/lib/ci/gitlab_ci_yaml_processor.rb @@ -80,12 +80,7 @@ module Ci { stage_idx: @stages.index(job[:stage]), stage: job[:stage], - ## - # Refactoring note: - # - before script behaves differently than after script - # - after script returns an array of commands - # - before script should be a concatenated command - commands: [job[:before_script] || @before_script, job[:script]].flatten.compact.join("\n"), + commands: job[:commands], tag_list: job[:tags] || [], name: name, only: job[:only], @@ -124,8 +119,12 @@ module Ci end def validate_job_keys!(name, job) + ## + # TODO, remove refactoring keys + # + refactoring_keys = [:commands] job.keys.each do |key| - unless ALLOWED_JOB_KEYS.include? key + unless (ALLOWED_JOB_KEYS + refactoring_keys).include? key raise ValidationError, "#{name} job: unknown parameter #{key}" end end -- cgit v1.2.3