Implement bare-bones /jobs/:job_id/debug endpoint

This commit is contained in:
Hiro Asari 2016-02-29 12:04:06 -10:00
parent f319dfbf65
commit 022089adc8

View File

@ -124,6 +124,13 @@ class Travis::Api::App
end
end
post "/:job_id/debug" do
job = service(:find_job, params).run
cfg = job.config
cfg.merge! debug_data
job.save!
end
def archive_url(path)
"https://s3.amazonaws.com/#{hostname('archive')}#{path}"
end
@ -131,6 +138,16 @@ class Travis::Api::App
def hostname(name)
"#{name}#{'-staging' if Travis.env == 'staging'}.#{Travis.config.host.split('.')[-2, 2].join('.')}"
end
def debug_data
{
debug: {
stage: 'before_install',
previous_status: 'failed',
created_by: current_user.login
}
}
end
end
end
end