summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulien Bisconti <julien.bisconti@gmail.com>2015-12-03 14:46:01 +0100
committerJulien Bisconti <julien.bisconti@gmail.com>2015-12-03 14:46:01 +0100
commit06f02629c624287cdfa19216283cafb25ff0fb2b (patch)
treef9e2cf0d16f8939c887f0a1a5baec08545eb9a49
parent4d329f654dbd23fe95931f11b1cbb15d56fc6c1a (diff)
downloadGit-Auto-Deploy-06f02629c624287cdfa19216283cafb25ff0fb2b.zip
Git-Auto-Deploy-06f02629c624287cdfa19216283cafb25ff0fb2b.tar.gz
Git-Auto-Deploy-06f02629c624287cdfa19216283cafb25ff0fb2b.tar.bz2
add option: remote
-rw-r--r--GitAutoDeploy.conf.json.example1
-rwxr-xr-xGitAutoDeploy.py5
2 files changed, 4 insertions, 2 deletions
diff --git a/GitAutoDeploy.conf.json.example b/GitAutoDeploy.conf.json.example
index 47bf187..8d9bcea 100644
--- a/GitAutoDeploy.conf.json.example
+++ b/GitAutoDeploy.conf.json.example
@@ -10,6 +10,7 @@
[{
"url": "https://github.com/olipo186/Git-Auto-Deploy.git",
"branch": "master",
+ "remote": "origin",
"path": "~/repositories/Git-Auto-Deploy",
"deploy": "echo deploying"
},
diff --git a/GitAutoDeploy.py b/GitAutoDeploy.py
index 2060df6..4f18c95 100755
--- a/GitAutoDeploy.py
+++ b/GitAutoDeploy.py
@@ -60,14 +60,15 @@ class GitWrapper():
from subprocess import call
branch = ('branch' in repo_config) and repo_config['branch'] or 'master'
+ remote = ('remote' in repo_config) and repo_config['remote'] or 'origin'
print "Post push request received"
print 'Updating ' + repo_config['path']
cmd = 'cd "' + repo_config['path'] + '"' \
'&& unset GIT_DIR ' + \
- '&& git fetch origin ' + \
- '&& git reset --hard origin/' + branch + ' ' + \
+ '&& git fetch ' + remote + \
+ '&& git reset --hard ' + remote + '/' + branch + ' ' + \
'&& git submodule init ' + \
'&& git submodule update'