Skip to content

Instantly share code, notes, and snippets.

@frodopwns
Created July 8, 2014 17:39
Show Gist options
  • Save frodopwns/a6125c2d1d2f2ec5ebf8 to your computer and use it in GitHub Desktop.
Save frodopwns/a6125c2d1d2f2ec5ebf8 to your computer and use it in GitHub Desktop.
Deploy repos with nested submodules
from fabric.api import *
def deep_snd(path_to_repo):
if path_to_repo[0] != '/':
path_to_repo = local("readlink -f {}".format(path_to_repo), capture=True)
dirs = local("find {} -name .gitmodules".format(path_to_repo), capture=True)
dirs = [x.rstrip(".gitmodules") for x in dirs.split()]
with lcd(path_to_repo):
local("git pull")
for d in dirs:
with lcd(d):
local("git submodule init")
local("git submodule update")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment