diff options
Diffstat (limited to 'GitAutoDeploy.py')
-rwxr-xr-x | GitAutoDeploy.py | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/GitAutoDeploy.py b/GitAutoDeploy.py index 00b852e..84ebd27 100755 --- a/GitAutoDeploy.py +++ b/GitAutoDeploy.py @@ -83,10 +83,23 @@ class GitAutoDeploy(BaseHTTPRequestHandler): config = self.getConfig() for repository in config['repositories']: if(repository['path'] == path): + cmds = [] if 'deploy' in repository: - if(not self.quiet): - print 'Executing deploy command' - call(['cd "' + path + '" && ' + repository['deploy']], shell=True) + cmds.append(repository['deploy']) + + gd = config['global_deploy'] + print gd + if len(gd[0]) is not 0: + cmds.insert(0, gd[0]) + if len(gd[1]) is not 0: + cmds.append(gd[1]) + + if(not self.quiet): + print 'Executing deploy command(s)' + print cmds + for cmd in cmds: + call(['cd "' + path + '" && ' + cmd], shell=True) + break |