From 9028c8139f5554cc123587d8b150e6d26850e46f Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Wed, 25 Jan 2017 12:24:39 +0100 Subject: [PATCH] Retrieving some properties from jason data --- lib/webhooks/deploy.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/webhooks/deploy.py b/lib/webhooks/deploy.py index 126afed..0aa1e4d 100644 --- a/lib/webhooks/deploy.py +++ b/lib/webhooks/deploy.py @@ -63,6 +63,10 @@ class WebhookDeployApp(object): self.data = None self.json_data = None + self.ref = None + self.namespace = None + self.name = None + self.full_name = None self._log_directory = os.sep + os.path.join('var', 'log', 'webhooks') @@ -244,6 +248,12 @@ class WebhookDeployApp(object): sys.exit(0) LOG.debug("Got JSON data:\n{}".format(pp(self.json_data))) + + self.ref = self.json_data['ref'].split('/')[-1] + self.namespace = self.json_data['project']['namespace'] + self.name = self.json_data['project']['name'] + self.full_name = self.json_data['project']['path_with_namespace'] + sys.exit(0) # ============================================================================= -- 2.39.5