Skip to content

Instantly share code, notes, and snippets.

@si9ma
Forked from iedemam/gist:9830045
Last active March 11, 2019 07:25
Show Gist options
  • Save si9ma/2fc72c0707777e6cbb499394ed4c41c9 to your computer and use it in GitHub Desktop.
Save si9ma/2fc72c0707777e6cbb499394ed4c41c9 to your computer and use it in GitHub Desktop.
Automatically manipulate .gitmodules so Travis CI pulls submodules from public URL instead of SSH URL.
#
# I use SSH URLs in my submodules for convenience. However, Travis CI is unable to
# clone from those URLs even though the repositories are public. To fix this, I'm
# simply manipulating the .gitmodules file with sed so it points to the public
# URLs before initializing the submodules.
#
# Hope it saves you some frustration!
#
# disable the default submodule logic
git:
submodules: false
# use sed to replace the SSH URL with the public URL, then init and update submodules
before_install:
- sed -i 's/git@github.com:/https:\/\/github.com\//' .gitmodules
- git submodule update --init --recursive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment