diff options
author | Alexander Nestorov <alexandernst@gmail.com> | 2014-09-19 10:37:42 +0200 |
---|---|---|
committer | Alexander Nestorov <alexandernst@gmail.com> | 2014-09-19 10:37:51 +0200 |
commit | 40c408413a816f39adef2edeb8124f21c1fe1a1c (patch) | |
tree | 9ec02e0e0ad5d2043dac0f20c77498f889756ffc /GitAutoDeploy.py | |
parent | d64e036eeafed4e8c8ba6b105408d62f405c64c3 (diff) | |
download | Git-Auto-Deploy-40c408413a816f39adef2edeb8124f21c1fe1a1c.zip Git-Auto-Deploy-40c408413a816f39adef2edeb8124f21c1fe1a1c.tar.gz Git-Auto-Deploy-40c408413a816f39adef2edeb8124f21c1fe1a1c.tar.bz2 |
Add global deploy commands
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 |