]> Frank Brehm's Git Trees - pixelpark/puppetmaster-webhooks.git/commitdiff
Retrieving some properties from jason data
authorFrank Brehm <frank.brehm@pixelpark.com>
Wed, 25 Jan 2017 11:24:39 +0000 (12:24 +0100)
committerFrank Brehm <frank.brehm@pixelpark.com>
Wed, 25 Jan 2017 11:24:39 +0000 (12:24 +0100)
lib/webhooks/deploy.py

index 126afed1e36b86f917d62d308ab6dc1c1f7c8a48..0aa1e4dd493a51b5b58a0973db330a6623a94ad5 100644 (file)
@@ -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)
 
 # =============================================================================