Example #1
0
def getChanges(request, options=None):
    """
    Reponds only to POST events and starts the build process

    :arguments:
        request
            the http request object
    """
    payload = json.load(request.content)
    user = payload['user_name']
    repo = payload['repository']['name']
    repo_url = payload['repository']['url']
    raw_project = request.args.get('project', None)
    project = raw_project[0] if raw_project is not None else ''
    # This field is unused:
    #private = payload['repository']['private']
    changes = process_change(payload, user, repo, repo_url, project)
    log.msg("Received %s changes from gitlab" % len(changes))
    return (changes, 'git')
Example #2
0
#
# Copyright Buildbot Team Members

from buildbot.status.web.hooks.github import process_change
from buildbot.util import json
from twisted.python import log


def getChanges(request, options=None):
    """
    Reponds only to POST events and starts the build process

    :arguments:
        request
            the http request object
    """
    try:
        payload = json.load(request.content)
    except Exception, e:
        raise ValueError("Error loading JSON: " + str(e))
    user = payload['user_name']
    repo = payload['repository']['name']
    repo_url = payload['repository']['url']
    raw_project = request.args.get('project', None)
    project = raw_project[0] if raw_project is not None else ''
    # This field is unused:
    #private = payload['repository']['private']
    changes = process_change(payload, user, repo, repo_url, project)
    log.msg("Received %s changes from gitlab" % len(changes))
    return (changes, 'git')
Example #3
0
def getChanges(request, options=None):
    """
    Reponds only to POST events and starts the build process

    :arguments:
        request
            the http request object
    """
    try:
        payload = json.load(request.content)
    except Exception, e:
        raise ValueError("Error loading JSON: " + str(e))
    user = payload['user_name']
    repo = payload['repository']['name']
    repo_url = payload['repository']['url']
    project = request.args.get('project', [''])[0]
    codebase = request.args.get('codebase', None)
    if codebase:
        codebase = codebase[0]
    # This field is unused:
    # private = payload['repository']['private']
    changes = process_change(payload,
                             user,
                             repo,
                             repo_url,
                             project,
                             codebase=codebase)
    log.msg("Received %s changes from gitlab" % len(changes))
    return (changes, 'git')
Example #4
0
from buildbot.status.web.hooks.github import process_change
from buildbot.util import json
from twisted.python import log


def getChanges(request, options=None):
    """
    Reponds only to POST events and starts the build process

    :arguments:
        request
            the http request object
    """
    try:
        payload = json.load(request.content)
    except Exception, e:
        raise ValueError("Error loading JSON: " + str(e))
    user = payload['user_name']
    repo = payload['repository']['name']
    repo_url = payload['repository']['url']
    project = request.args.get('project', [''])[0]
    codebase = request.args.get('codebase', None)
    if codebase:
        codebase = codebase[0]
    # This field is unused:
    # private = payload['repository']['private']
    changes = process_change(payload, user, repo, repo_url, project, codebase=codebase)
    log.msg("Received %s changes from gitlab" % len(changes))
    return (changes, 'git')