diff options
author | Oliver Poignant <oliver@poignant.se> | 2016-12-12 18:35:03 +0100 |
---|---|---|
committer | Oliver Poignant <oliver@poignant.se> | 2016-12-12 18:35:03 +0100 |
commit | 8c406865ce388c1856f8dab495df4aa11f64f9cd (patch) | |
tree | d85ca148d33d9fd7e3fa37f564546e687a17c276 /gitautodeploy/gitautodeploy.py | |
parent | 30b8b34af911c3b3661f57366f0eeb56bfb5e3ed (diff) | |
download | Git-Auto-Deploy-8c406865ce388c1856f8dab495df4aa11f64f9cd.zip Git-Auto-Deploy-8c406865ce388c1856f8dab495df4aa11f64f9cd.tar.gz Git-Auto-Deploy-8c406865ce388c1856f8dab495df4aa11f64f9cd.tar.bz2 |
Refactoring and preparations for JSON API
Diffstat (limited to 'gitautodeploy/gitautodeploy.py')
-rw-r--r-- | gitautodeploy/gitautodeploy.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/gitautodeploy/gitautodeploy.py b/gitautodeploy/gitautodeploy.py index 829d76c..167fae8 100644 --- a/gitautodeploy/gitautodeploy.py +++ b/gitautodeploy/gitautodeploy.py @@ -227,6 +227,12 @@ class GitAutoDeploy(object): return 0 + def update(self, action, message=None): + pass + #print "%s was updated" % action, +# if message: +# print "Message: %s" % message + def setup(self, config): """Setup an instance of GAD based on the provided config object.""" import sys @@ -236,6 +242,7 @@ class GitAutoDeploy(object): import logging from lock import Lock from httpserver import WebhookRequestHandlerFactory + from events import EventStore # This solves https://github.com/olipo186/Git-Auto-Deploy/issues/118 try: @@ -247,7 +254,6 @@ class GitAutoDeploy(object): def emit(self, record): pass - # Attatch config values to this instance self._config = config @@ -320,8 +326,12 @@ class GitAutoDeploy(object): Lock(os.path.join(repo_config['path'], 'status_waiting')).clear() try: + + event_store = EventStore() + event_store.register_observer(self) + # Create web hook request handler class - WebhookRequestHandler = WebhookRequestHandlerFactory(self._config) + WebhookRequestHandler = WebhookRequestHandlerFactory(self._config, event_store) self._server = HTTPServer((self._config['host'], self._config['port']), |