diff options
author | Kiyan Shalileh <kiyan.shalileh@gmail.com> | 2016-06-26 19:08:28 +0430 |
---|---|---|
committer | Kiyan Shalileh <kiyan.shalileh@gmail.com> | 2016-06-26 19:08:28 +0430 |
commit | 055344616f1672b2c27f8b8befb95d1541b1942c (patch) | |
tree | 8180b0262cea311626fc52c413f6967330cce69f /gitautodeploy/httpserver.py | |
parent | b805e3f4554fc2854bb78923b17c906d8ebf9b4f (diff) | |
download | Git-Auto-Deploy-055344616f1672b2c27f8b8befb95d1541b1942c.zip Git-Auto-Deploy-055344616f1672b2c27f8b8befb95d1541b1942c.tar.gz Git-Auto-Deploy-055344616f1672b2c27f8b8befb95d1541b1942c.tar.bz2 |
Fixing GitlabCi parser
Diffstat (limited to 'gitautodeploy/httpserver.py')
-rw-r--r-- | gitautodeploy/httpserver.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/gitautodeploy/httpserver.py b/gitautodeploy/httpserver.py index 8032556..d9310d1 100644 --- a/gitautodeploy/httpserver.py +++ b/gitautodeploy/httpserver.py @@ -131,7 +131,11 @@ class WebhookRequestHandler(BaseHTTPRequestHandler): # Assume GitLab if the X-Gitlab-Event HTTP header is set if 'x-gitlab-event' in request_headers: - return parsers.GitLabRequestParser + # Special Case for Gitlab CI + if content_type == "application/json" and "build_status" in data: + return parsers.GitLabCIRequestParser + else: + return parsers.GitLabRequestParser # Assume GitHub if the X-GitHub-Event HTTP header is set elif 'x-github-event' in request_headers: @@ -144,11 +148,6 @@ class WebhookRequestHandler(BaseHTTPRequestHandler): return parsers.BitBucketRequestParser - # Special Case for Gitlab CI - elif content_type == "application/json" and "build_status" in data: - - return parsers.GitLabCIRequestParser - # This handles old GitLab requests and Gogs requests for example. elif content_type == "application/json": @@ -305,4 +304,4 @@ class WebhookRequestHandler(BaseHTTPRequestHandler): file = open(target, 'w') file.write(json.dumps(test_case, sort_keys=True, indent=4)) - file.close()
\ No newline at end of file + file.close() |