summaryrefslogtreecommitdiff
path: root/app/presenters
diff options
context:
space:
mode:
authorShinya Maeda <shinya@gitlab.com>2017-09-04 22:21:47 +0900
committerShinya Maeda <shinya@gitlab.com>2017-09-04 22:21:47 +0900
commit5b88bd81f52b454c80c54bef9951bdb8cf607238 (patch)
treec2258ceecd95eb391b2d54715b49b310cefb5ef5 /app/presenters
parentfa6b9acaf9759c58353f8407ff20a7d02b8edf92 (diff)
downloadgitlab-ce-5b88bd81f52b454c80c54bef9951bdb8cf607238.tar.gz
Move trigger_variables to presenter
Diffstat (limited to 'app/presenters')
-rw-r--r--app/presenters/ci/build_presenter.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/app/presenters/ci/build_presenter.rb b/app/presenters/ci/build_presenter.rb
index c495c3f39bb..255475e1fe6 100644
--- a/app/presenters/ci/build_presenter.rb
+++ b/app/presenters/ci/build_presenter.rb
@@ -17,5 +17,16 @@ module Ci
"Job is redundant and is auto-canceled by Pipeline ##{auto_canceled_by_id}"
end
end
+
+ def trigger_variables
+ return [] unless trigger_request
+
+ @trigger_variables ||=
+ if pipeline.variables.any?
+ pipeline.variables.map(&:to_runner_variable)
+ else
+ trigger_request.user_variables
+ end
+ end
end
end