I recently turned a couple of my plugins into submodules and realized that when you “git clone” a repository, the submodule directory will be empty. This makes sense for co-developers to initialize their submodules and update.
However, when I deploy with capistrano the submodule code will obviously not be deployed which causes problems. I could go into the release branch and init and update the module there, but that is obviously not an ideal solution.
Does anyone have suggestions about how to handle this? Is it as simple as a capistrano task?
I am a bit of a noob on the production side of things.
Thank you!
According to this recent thread, capistrano should be able to init and update your submodules:
in config/deploy.rb should be enough, if your
.gitmodulesentries are up to date.You may need to patch Capistrano (
lib/capistano/recipes/deploy/scm/git.rb) to make sure your submodules get included though.If you have nested submodules, you need:
Just require it at your deployment config:
require ‘capistrano/deepmodules’