]> Frank Brehm's Git Trees - pixelpark/puppetmaster-webhooks.git/commitdiff
Adding sample input data to lib/webhooks/deploy.py
authorFrank Brehm <frank.brehm@pixelpark.com>
Wed, 25 Jan 2017 10:32:22 +0000 (11:32 +0100)
committerFrank Brehm <frank.brehm@pixelpark.com>
Wed, 25 Jan 2017 10:32:22 +0000 (11:32 +0100)
lib/webhooks/deploy.py

index ebacf7be5d231bd77220c4670270a0ddc9f6891a..126afed1e36b86f917d62d308ab6dc1c1f7c8a48 100644 (file)
@@ -172,9 +172,63 @@ class WebhookDeployApp(object):
     def __call__(self):
         """Helper method to make the resulting object callable."""
 
+        """
+        Sample data:
+        {   'after': '257b9af29a2b8f15469770e41b852cbcd2b7c49f',
+            'before': '0e3270098b00f74a3934956784f62c095cf9f7f0',
+            'checkout_sha': '257b9af29a2b8f15469770e41b852cbcd2b7c49f',
+            'commits': [
+                {   'added': [],
+                    'author': {
+                        'email': 'frank.brehm@pixelpark.com',
+                        'name': 'Frank Brehm'},
+                    'id': '257b9af29a2b8f15469770e41b852cbcd2b7c49f',
+                    'message': 'Fixing lib/webhooks/deploy.py\n',
+                    'modified': ['lib/webhooks/deploy.py'],
+                    'removed': [],
+                    'timestamp': '2017-01-25T11:20:47+01:00',
+                    'url': 'https://git.pixelpark.com/ppadmin/puppetmaster-webhooks/commit/257b9...'
+                }
+            ],
+            'event_name': 'push',
+            'message': None,
+            'object_kind': 'push',
+            'project': {
+                'avatar_url': None,
+                'default_branch': 'master',
+                'description': 'The Gitlab webhook scripts for the puppetmaster server.',
+                'git_http_url': 'https://git.pixelpark.com/ppadmin/puppetmaster-webhooks.git',
+                'git_ssh_url': 'git@git.pixelpark.com:ppadmin/puppetmaster-webhooks.git',
+                'homepage': 'https://git.pixelpark.com/ppadmin/puppetmaster-webhooks',
+                'http_url': 'https://git.pixelpark.com/ppadmin/puppetmaster-webhooks.git',
+                'name': 'puppetmaster-webhooks',
+                'namespace': 'ppadmin',
+                'path_with_namespace': 'ppadmin/puppetmaster-webhooks',
+                'ssh_url': 'git@git.pixelpark.com:ppadmin/puppetmaster-webhooks.git',
+                'url': 'git@git.pixelpark.com:ppadmin/puppetmaster-webhooks.git',
+                'visibility_level': 0,
+                'web_url': 'https://git.pixelpark.com/ppadmin/puppetmaster-webhooks'
+            },
+            'project_id': 2321,
+            'ref': 'refs/heads/develop',
+            'repository': {
+                'description': 'The Gitlab webhook scripts for the puppetmaster server.',
+                'git_http_url': 'https://git.pixelpark.com/ppadmin/puppetmaster-webhooks.git',
+                'git_ssh_url': 'git@git.pixelpark.com:ppadmin/puppetmaster-webhooks.git',
+                'homepage': 'https://git.pixelpark.com/ppadmin/puppetmaster-webhooks',
+                'name': 'puppetmaster-webhooks',
+                'url': 'git@git.pixelpark.com:ppadmin/puppetmaster-webhooks.git',
+                'visibility_level': 0
+            },
+            'total_commits_count': 1,
+            'user_avatar': 'https://git.pixelpark.com/uploads/user/avatar/395/avatar.png',
+            'user_email': 'frank.brehm@publicispixelpark.de',
+            'user_id': 395,
+            'user_name': 'Frank Brehm'}
+        """
+
         print("Content-Type: text/plain;charset=utf-8")
         print()
-        #print(to_bytes("Python CGI läuft"))
         sys.stdout.buffer.write(to_bytes("Python CGI läuft.\n"))
 
         LOG.info("Starting ...")