Shippable builds with Git submodules

- By Charlie Crawford on April 09, 2015

Sometimes it doesn't make sense to put all your code into one repo. It's common for projects to be spread across multiple repos, and linked together via git submodules. Shippable supports this workflow and all that's required is a few extra lines in your shippable.yml! If all the repos involved are public, you simply have to include commands to init and update the submodules in your shippable.yml file. Here's an example snippet:

script:
- git submodule init
- git submodule update


This will initialize and download all the contents of your contained submodule, making them available for use. Remember though: setting anything in the script section overwrites the default commands for the section. For example, if you were relying on the implicit rake command for your ruby project in this section, you must manually add it back in. The resulting shippable.yml file:

script:
- git submodule init
- git submodule update
- rake

This advice holds for all application types, so remember to add the command to run your app back into the script section! Have fun using submodules in your builds!

Topics: development process, continuous integration (CI), how-to