Example #1
0
def api_force_build(request, assignment_id):
    if request.method != "POST":
        return HttpResponseBadRequest(["POST"])

    assignment = get_object_or_404(JobAssignment, pk=assignment_id).get_domain_object()
    
    master = assignment.project.get_buildmaster()

    from urllib import unquote_plus

    data = deserialize(unquote_plus(request.POST.get("data")))

    forcer = BuildForcer(assignment=assignment, master=master, buildbot_data=data)
    forcer.run()

    #TODO: maybe return some status, like build number
    return HttpResponse('{}')
Example #2
0
 def force_build(self):
     forcer = BuildForcer(master=self.model.project.buildmaster, assignment=self)
     forcer.run()
     return forcer