def run_cancel(proj, build, run): url = JOBSERV_URL + '/projects/%s/builds/%s/runs/%s/cancel' % (proj, build, run) r = current_user.authenticated_post(url) if r.status_code != 202: abort(make_response(r.text, r.status_code)) return redirect(url_for('jobserv.run', proj=proj, build=build, run=run))
def project_create(): name = request.form['name'] r = current_user.authenticated_post(JOBSERV_URL + '/projects/', json={'name': name}) if r.status_code != 201: abort(make_response(r.text, r.status_code)) return redirect(url_for('jobserv.project', proj=name))
def project_create_github_trigger(proj): if current_user.is_admin: proj = _get('/projects/%s/' % proj)['project'] _assert_form(proj, request.form) url = JOBSERV_URL + '/github/%s/webhook/' % proj['name'] r = current_user.authenticated_post(url, json=request.form) if r.status_code != 201: abort(make_response(r.text, r.status_code)) flash('Trigger created for GitHub project') return redirect(url_for('jobserv.project', proj=proj['name'])) abort(404)