summaryrefslogtreecommitdiff
path: root/lib/api/runner.rb
diff options
context:
space:
mode:
authorFrancisco Javier López <fjlopez@gitlab.com>2018-07-05 13:55:10 +0000
committerDouwe Maan <douwe@gitlab.com>2018-07-05 13:55:10 +0000
commita7a1531fe5d030d47d63bfcd86a7168a8437ff86 (patch)
tree65854ce75eb6b6f6061fef114f95076fae2ab9a8 /lib/api/runner.rb
parent9a62e72db9892708ab360c59a9f77695d9253c34 (diff)
downloadgitlab-ce-a7a1531fe5d030d47d63bfcd86a7168a8437ff86.tar.gz
Web Terminal Ci Build
Diffstat (limited to 'lib/api/runner.rb')
-rw-r--r--lib/api/runner.rb13
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/api/runner.rb b/lib/api/runner.rb
index b4b984f7b8f..d0cc0945a5f 100644
--- a/lib/api/runner.rb
+++ b/lib/api/runner.rb
@@ -81,6 +81,11 @@ module API
requires :token, type: String, desc: %q(Runner's authentication token)
optional :last_update, type: String, desc: %q(Runner's queue last_update token)
optional :info, type: Hash, desc: %q(Runner's metadata)
+ optional :session, type: Hash, desc: %q(Runner's session data) do
+ optional :url, type: String, desc: %q(Session's url)
+ optional :certificate, type: String, desc: %q(Session's certificate)
+ optional :authorization, type: String, desc: %q(Session's authorization)
+ end
end
post '/request' do
authenticate_runner!
@@ -90,14 +95,16 @@ module API
break no_content!
end
- if current_runner.runner_queue_value_latest?(params[:last_update])
- header 'X-GitLab-Last-Update', params[:last_update]
+ runner_params = declared_params(include_missing: false)
+
+ if current_runner.runner_queue_value_latest?(runner_params[:last_update])
+ header 'X-GitLab-Last-Update', runner_params[:last_update]
Gitlab::Metrics.add_event(:build_not_found_cached)
break no_content!
end
new_update = current_runner.ensure_runner_queue_value
- result = ::Ci::RegisterJobService.new(current_runner).execute
+ result = ::Ci::RegisterJobService.new(current_runner).execute(runner_params)
if result.valid?
if result.build