Skip to content

Commit 03a09ce

Browse files
committed
Support deployment of a branch
Allow the configuration to specify a branch to deploy. The deploy command will only be run if there is a push to the configured branch.
1 parent 7a8d69c commit 03a09ce

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

GitAutoDeploy.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,12 @@ def deploy(self, path):
8484
for repository in config['repositories']:
8585
if(repository['path'] == path):
8686
if 'deploy' in repository:
87-
if(not self.quiet):
88-
print 'Executing deploy command'
89-
call(['cd "' + path + '" && ' + repository['deploy']], shell=True)
87+
if 'branch' in repository and repository['branch'] == self.branch:
88+
if(not self.quiet):
89+
print 'Executing deploy command'
90+
call(['cd "' + path + '" && ' + repository['deploy']], shell=True)
91+
elif not self.quiet:
92+
print 'Push to different branch (%s != %s), not deploying' % (repository['branch'], self.branch)
9093
break
9194

9295
def main():

0 commit comments

Comments
 (0)