diff options
author | Tomasz Maczukin <tomasz@maczukin.pl> | 2018-06-07 16:17:44 +0300 |
---|---|---|
committer | Tomasz Maczukin <tomasz@maczukin.pl> | 2018-06-07 16:17:44 +0300 |
commit | 435e661a2ec060c4b7349b26b506243c27e8cc30 (patch) | |
tree | 490f83a3dd46b18bead2bb82d96279f1ff6f5e66 /lib/api/runner.rb | |
parent | df326d061e23a7d5eb2618e542c193d4aef79c1a (diff) |
Introduce new keep-alive API entrypoint for CI job
Diffstat (limited to 'lib/api/runner.rb')
-rw-r--r-- | lib/api/runner.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/api/runner.rb b/lib/api/runner.rb index db502697a19..ac62b83ba4a 100644 --- a/lib/api/runner.rb +++ b/lib/api/runner.rb @@ -140,6 +140,22 @@ module API end end + desc 'Marks job as live' do + http_codes [[200, 'Request accepted']] + end + params do + requires :id, type: Integer, desc: %q(Job's ID) + optional :token, type: String, desc: %q(Job's authentication token) + end + post '/:id/keep-alive' do + job = authenticate_job! + + job.touch if job.running? && job.needs_touch? + + status 200 + header 'Job-Status', job.status + end + desc 'Appends a patch to the job trace' do http_codes [[202, 'Trace was patched'], [400, 'Missing Content-Range header'], |