This is the guide for using submodules in your Pagoda Box app. When you deploy your app we create the submodules based on what version you have stored in your repo, so it is important for you to properly add and update the submodules.
After reading this guide you should be able to:
- Add Submodules
- Update Submodules
Adding submodules is very easy
Example urls from github:
- SSH: firstname.lastname@example.org:demo-username/demo.git
- Git Read-Only: git://github.com/demo-username/demo.git
Pagoda Box is only able to create submodules as long as the submodule was added with either the SSH or Git Read-Only URL.
The init command registers the submodule to your repo so any of your collaborators who pull will get the contents of the submodule instead of just the folder.
Private Submodule Repos
If your submodule is in a private repo you'll need to grant Pagoda Box access to pull from that repo. You can do so by adding Pagoda Box's public SSH Key to the repo. If it's a github repo, you can accomplish the same thing by simply adding 'pagodabox' as a collaborator.
SSHPublic SSH Key
As time passes you may need to update your submodule in your app. To do this, all you need to do is navigate to the directory, checkout the appropriate branch if your not already on that branch and do a git pull. After pulling, you then navigate to the root directory of your app and commit the changes and push.
Since updating the submodule entails using a git pull command, you can also revert the branch by pulling a different commit.