diff options
author | Karl <fartman@gmx.de> | 2012-12-25 11:29:26 -0800 |
---|---|---|
committer | Karl <fartman@gmx.de> | 2012-12-25 11:29:26 -0800 |
commit | 65c239683f61c0f152645433b431feffb5da5cc3 (patch) | |
tree | 03c963dd6730390e436e1e7c267e278dcdca6786 /GitAutoDeploy.py | |
parent | 3084ba74f974f47c5ecb91cc213d29154c739ab4 (diff) | |
parent | b04d872e2be441422a7b9819ae40f28be25c37a9 (diff) | |
download | Git-Auto-Deploy-65c239683f61c0f152645433b431feffb5da5cc3.zip Git-Auto-Deploy-65c239683f61c0f152645433b431feffb5da5cc3.tar.gz Git-Auto-Deploy-65c239683f61c0f152645433b431feffb5da5cc3.tar.bz2 |
Merge pull request #8 from scarnie/master
All multiple deployments from same source repository. fixes #6
Diffstat (limited to 'GitAutoDeploy.py')
-rwxr-xr-x | GitAutoDeploy.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/GitAutoDeploy.py b/GitAutoDeploy.py index 78cadd9..d642e95 100755 --- a/GitAutoDeploy.py +++ b/GitAutoDeploy.py @@ -35,9 +35,10 @@ class GitAutoDeploy(BaseHTTPRequestHandler): def do_POST(self): urls = self.parseRequest() for url in urls: - path = self.getMatchingPath(url) - self.pull(path) - self.deploy(path) + paths = self.getMatchingPaths(url) + for path in paths: + self.pull(path) + self.deploy(path) def parseRequest(self): length = int(self.headers.getheader('content-length')) @@ -49,11 +50,13 @@ class GitAutoDeploy(BaseHTTPRequestHandler): items.append(item['repository']['url']) return items - def getMatchingPath(self, repoUrl): + def getMatchingPaths(self, repoUrl): + res = [] config = self.getConfig() for repository in config['repositories']: if(repository['url'] == repoUrl): - return repository['path'] + res.append(repository['path']) + return res def respond(self): self.send_response(200) |