deployer: Submodule init problem

Hi

I have problem in task deploy:update_code when my repo is using some submodules. Deploy skript is trying to run something like this:

cd /home/user/mytest && git clone --recursive -q git@bitbucket.org:owner/repo.git /home/user/mytest/releases/2015012324229

But it fails 😦

[RuntimeException]
  Cloning into 'htdocs/somefolder1'...
  Cloning into 'htdocs/somefolder2'...
  Cloning into 'htdocs/somefolder3'...
  Cloning into 'htdocs/somefolder4'...

I am using php ssh2 lib. I have tried to debug this issue and it fails in vendor/elfet/php-ssh/src/Ssh/Exec.php:30 when command returns something to output it will consider it as fail and. git command outputs information with ā€œCloning intoā€ for submodules (event you pass -q variable). There is no permission problem, I can run command that I mentioned on the top and it runs ok (but output information about initialising submodules)

Anyone have any ideas how to fix this?

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 18 (11 by maintainers)

Most upvoted comments

@itelmenko Happy to help - I just don’t want a ā€œbut submodules are betterā€ discussion 😃 I’m happy with composer, if you are with submodules, great!

That said, depending on the situation I have two ways to make quick and easy fixes to dependencies while managing these with composer:

  1. Adding a path-repository, git clone the dependency into it and then ā€œoverwriteā€ the remote version with the local one. So you can add changes to it, have a second branch, etc. and once it is done push it, open pr, merge it, etc. The cool thing about this way is, that your path repository will not be deleted accidentaly, as in the second way:
  2. The alternative is to run composer install --prefer-install=source, so the vendor directory contains mostly git/vcs clones/checkouts if possible. So you can change anything, change branches and push the changes as well. Depending on the situation the cool/horrible situation is, that the next composer install or update deletes all your changes (although composer is complaining about changes in vendor/ before simply deleting/updating it. Hope that helps!