summaryrefslogtreecommitdiffstats
path: root/GitAutoDeploy.py
diff options
context:
space:
mode:
authorOliver Poignant <oliver@poignant.se>2015-07-09 08:46:08 +0200
committerOliver Poignant <oliver@poignant.se>2015-07-09 08:46:08 +0200
commitb0a71491637beee7b5a4e1c3de2305952a633746 (patch)
tree4006c3a6c464cef18165195461d8b4b652847082 /GitAutoDeploy.py
parent3b07fd3830036c66a7655f6deee12d521b086291 (diff)
parent5c4d7a71276fa0c08145da2ef4fee26f6aadb8b9 (diff)
downloadGit-Auto-Deploy-b0a71491637beee7b5a4e1c3de2305952a633746.zip
Git-Auto-Deploy-b0a71491637beee7b5a4e1c3de2305952a633746.tar.gz
Git-Auto-Deploy-b0a71491637beee7b5a4e1c3de2305952a633746.tar.bz2
Merge pull request #28 from letorbi/submodule-support
Fix for locked repo bug & submodule support
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 56c75a1..563dbb5 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 + '" && git fetch origin ; git update-index --refresh &> /dev/null ; 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