summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzegorz@gitlab.com>2017-07-14 16:19:39 +0000
committerGrzegorz Bizon <grzegorz@gitlab.com>2017-07-14 16:19:39 +0000
commit0749fdcf27943f587923010608649789be70b8d7 (patch)
treedd795b991383bfcee52bd5aad4a6aaba166927ae /lib
parent28709a4d531013dd6c99274483f6fae51a493eec (diff)
parent6d272f8e7d76f891c1db3a8145105004e11eed40 (diff)
downloadgitlab-ce-0749fdcf27943f587923010608649789be70b8d7.tar.gz
Merge branch 'pass-before-script-as-is' into 'master'
Pass before_script and script as-is preserving arrays See merge request !12680
Diffstat (limited to 'lib')
-rw-r--r--lib/ci/gitlab_ci_yaml_processor.rb2
-rw-r--r--lib/gitlab/ci/build/step.rb3
2 files changed, 4 insertions, 1 deletions
diff --git a/lib/ci/gitlab_ci_yaml_processor.rb b/lib/ci/gitlab_ci_yaml_processor.rb
index 56ad2c77c7d..cf3a0336792 100644
--- a/lib/ci/gitlab_ci_yaml_processor.rb
+++ b/lib/ci/gitlab_ci_yaml_processor.rb
@@ -80,6 +80,8 @@ module Ci
artifacts: job[:artifacts],
cache: job[:cache],
dependencies: job[:dependencies],
+ before_script: job[:before_script],
+ script: job[:script],
after_script: job[:after_script],
environment: job[:environment]
}.compact }
diff --git a/lib/gitlab/ci/build/step.rb b/lib/gitlab/ci/build/step.rb
index ee034d9cc56..411f67f8ce7 100644
--- a/lib/gitlab/ci/build/step.rb
+++ b/lib/gitlab/ci/build/step.rb
@@ -12,7 +12,8 @@ module Gitlab
class << self
def from_commands(job)
self.new(:script).tap do |step|
- step.script = job.commands.split("\n")
+ step.script = job.options[:before_script].to_a + job.options[:script].to_a
+ step.script = job.commands.split("\n") if step.script.empty?
step.timeout = job.timeout
step.when = WHEN_ON_SUCCESS
end