summaryrefslogtreecommitdiffstats
path: root/GitAutoDeploy.py
diff options
context:
space:
mode:
authorAlexander Nestorov <alexandernst@gmail.com>2014-09-19 10:37:42 +0200
committerAlexander Nestorov <alexandernst@gmail.com>2014-09-19 10:37:51 +0200
commit40c408413a816f39adef2edeb8124f21c1fe1a1c (patch)
tree9ec02e0e0ad5d2043dac0f20c77498f889756ffc /GitAutoDeploy.py
parentd64e036eeafed4e8c8ba6b105408d62f405c64c3 (diff)
downloadGit-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-xGitAutoDeploy.py19
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