diff options
author | Stuart Carnie <stuart.carnie@gmail.com> | 2012-12-18 09:34:54 -0700 |
---|---|---|
committer | Stuart Carnie <stuart.carnie@gmail.com> | 2012-12-18 09:34:54 -0700 |
commit | b04d872e2be441422a7b9819ae40f28be25c37a9 (patch) | |
tree | 68c2a52182e6e4ac03d065b0f44e622478e4d636 /GitAutoDeploy.py | |
parent | d623dfaeff0546aa89832e76e9ab60aabf6d10fd (diff) | |
download | Git-Auto-Deploy-b04d872e2be441422a7b9819ae40f28be25c37a9.zip Git-Auto-Deploy-b04d872e2be441422a7b9819ae40f28be25c37a9.tar.gz Git-Auto-Deploy-b04d872e2be441422a7b9819ae40f28be25c37a9.tar.bz2 |
Add support for deploying from same repo
Same source URL can be used to deploy to multiple local repositories
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) |