summaryrefslogtreecommitdiffstats
path: root/GitAutoDeploy.py
diff options
context:
space:
mode:
authorTorben <torben.letorbi@gmail.com>2015-07-07 16:10:59 +0200
committerTorben <torben.letorbi@gmail.com>2015-07-07 16:51:09 +0200
commit5c4d7a71276fa0c08145da2ef4fee26f6aadb8b9 (patch)
treebcc72ad331395729a6898a0b38c95f21d0f651c3 /GitAutoDeploy.py
parentf40eaa8127624a7fd8dbf77b97c8db4130d6d2b8 (diff)
downloadGit-Auto-Deploy-5c4d7a71276fa0c08145da2ef4fee26f6aadb8b9.zip
Git-Auto-Deploy-5c4d7a71276fa0c08145da2ef4fee26f6aadb8b9.tar.gz
Git-Auto-Deploy-5c4d7a71276fa0c08145da2ef4fee26f6aadb8b9.tar.bz2
Add support for git submodules
Diffstat (limited to 'GitAutoDeploy.py')
-rwxr-xr-xGitAutoDeploy.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/GitAutoDeploy.py b/GitAutoDeploy.py
index 5fd5d51..f8ad134 100755
--- a/GitAutoDeploy.py
+++ b/GitAutoDeploy.py
@@ -31,7 +31,7 @@ class GitAutoDeploy(BaseHTTPRequestHandler):
for repository in myClass.config['repositories']:
if(not os.path.isdir(repository['path'])):
print "Directory %s not found" % repository['path']
- call(['git clone '+repository['url']+' '+repository['path']], shell=True)
+ call(['git clone --recursive '+repository['url']+' '+repository['path']], shell=True)
if(not os.path.isdir(repository['path'])):
print "Unable to clone repository %s" % repository['url']
sys.exit(2)
@@ -140,7 +140,7 @@ class GitAutoDeploy(BaseHTTPRequestHandler):
if(not self.quiet):
print "\nPost push request received"
print 'Updating ' + path
- res = call(['sleep 5; cd "' + path + '" && unset GIT_DIR && git fetch origin && git update-index --refresh && git reset --hard origin/' + branch], shell=True)
+ res = call(['sleep 5; cd "' + path + '" && unset GIT_DIR && git fetch origin && git update-index --refresh && git reset --hard origin/' + branch + ' && git submodule init && git submodule update'], shell=True)
call(['echo "Pull result: ' + str(res) + '"'], shell=True)
return res