NZX / capistrano-scm-gitcopy

Capsitrano 3 copy scm - tar your git branch and deploy to your server
MIT License
1 stars 0 forks source link

git submodule issue #3

Open Daniel-ltw opened 8 years ago

Daniel-ltw commented 8 years ago

Need to work out how to deploy with submodules.

DEBUG [f48f6bf3] Command: cd /tmp/new-hope-repository && ( PATH=/opt/ruby-2.2.3/bin:$PATH GIT_ASKPASS=/bin/echo GIT_SSH=/tmp/new-hope/git-ssh.sh /usr/bin/env git remote update )
DEBUG [f48f6bf3]    Fetching origin
DEBUG [f48f6bf3]    From github.com:NZX/a-new-hope
DEBUG [f48f6bf3]       271bdd5..3414a88  develop    -> develop
INFO [f48f6bf3] Finished in 3.790 seconds with exit status 0 (successful).
INFO [594974e5] Running /usr/bin/env git submodule update --init --remote as deploy@localhost
DEBUG [594974e5] Command: cd /tmp/new-hope-repository && ( PATH=/opt/ruby-2.2.3/bin:$PATH GIT_ASKPASS=/bin/echo GIT_SSH=/tmp/new-hope/git-ssh.sh /usr/bin/env git submodule update --init --remote )
DEBUG [594974e5]    fatal: /usr/libexec/git-core/git-submodule cannot be used without a working tree.

Tried adding the git submodule update command in lib/capistrano/gitcopy.rb

This did not work well and return the following error. Seems like it requires the actual working tree, which would require all repo files being cloned.

Is there a better way to solve this?

xuwupeng2000 commented 8 years ago

😭 sob

Daniel-ltw commented 8 years ago

I guess the whole problem lies at how we use --mirror during clone to reduce the disk usage and the time to clone.

Maybe we should not use --mirror?