git:create_release doesn't pull submodule
numbcoder opened this issue · comments
My rails app has a submodule which shared with other projects.
I have tried to migrate from mina to tomo to deploy my rails app, but I found that the git:create_release
task doesn't pull the submodule.
Tomo is awesome, thank you!
Hi, thanks for the report!
I'm actually not that familiar with git submodules. Do you have any suggestions on how tomo could support them?
As you can see, tomo's git:create_release
task is pretty straightforward. It does a git update
to pull the latest commits and then a git archive
to copy the contents of the repository to the release directory.
tomo/lib/tomo/plugin/git/tasks.rb
Lines 17 to 32 in cb2758d
Is there something missing here that is needed to support submodules?
It's very complicated to archive a git repository with submodules since tomo clone with the --mirror
option, the git submodule
command can not execute in a bare git dir.
In a normal(no-bare) git work tree,this script https://gist.github.com/arteymix/03702e3eb05c2c161a86b49d4626d21f could be used to archive a git repository with submodules.
My PR just use git submodule update --init --recursive --depth=1
to update submodules, It works for me.
Given my lack of familiarity with git submodules, I've decided not to build submodules support into tomo at this time. I appreciate the PR, though!
For a workaround, see: #220 (review)