deployer icon indicating copy to clipboard operation
deployer copied to clipboard

Empty response from command: $git config --get remote.origin.url

Open xmannv opened this issue 2 years ago • 8 comments

https://github.com/deployphp/deployer/blob/8e4366bb42f10421ea0aacc93f7bab59cf29d6ed/recipe/deploy/update_code.php#L95

I must add '-f config' to get correct result.

$git config -f config --get remote.origin.url

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar

xmannv avatar Jun 11 '22 15:06 xmannv

I also have problems because of remote.origin.url.

Task deploy:update_code generates infinite loop.

Probably it's because I don't have at all remote named origin in my repositories.

So I just commented this block, then task works fine:

https://github.com/deployphp/deployer/blob/8e4366bb42f10421ea0aacc93f7bab59cf29d6ed/recipe/deploy/update_code.php#L94-L99

sviriden avatar Jul 16 '22 10:07 sviriden

I also have problems because of remote.origin.url.

Task deploy:update_code generates infinite loop.

Probably it's because I don't have at all remote named origin in my repositories.

So I just commented this block, then task works fine:

https://github.com/deployphp/deployer/blob/8e4366bb42f10421ea0aacc93f7bab59cf29d6ed/recipe/deploy/update_code.php#L94-L99

Hello @sviriden where did you comment on this code? I am using laravel and I have commented out this code in vendor/deployer/deployer/recipe/deploy/update_code.php but it did not take effect because the deployer is still running the same command .. any suggestions on this?

Base29 avatar Nov 14 '22 07:11 Base29

@Base29, my solutions was:

Create new file deployer_update_code_custom.php and copy there all code from mentioned file vendor/deployer/deployer/recipe/deploy/update_code.php. Inside of this file comment rows 94-99.

Then in my deploy.yaml:

import:
  - deployer_update_code_custom.php

...

tasks:
  build:
    - cd: '{{release_path}}'
    - run: 'npm run build'
  deploy:
    - deploy:info
    - deploy:setup
    - deploy:lock
    - deploy:release
    - deploy:update_code_custom
    - deploy:shared
    - deploy:writable
    - deploy:vendors
    - artisan:storage:link
    - artisan:view:cache
    - artisan:config:cache
    - artisan:migrate
    - deploy:publish

Probably you should adjust deploy-tasks for your project.

Btw, I also use Laravel. Maybe this bug is Laravel-specific.

sviriden avatar Nov 14 '22 08:11 sviriden

Had the same issue, but the problem was actually a permissions issue on the server. The .dep folder in particular has to be owned by the user that is triggering the deployment.

jgarcia421 avatar May 09 '23 14:05 jgarcia421

For us this was an encoding problem comparing the two string.

We fixed that by changing the comparison to mb_strstr:

    if (mb_strstr(run("$git config --get remote.origin.url"), $repository) === false) {
        cd('{{deploy_path}}');
        run("rm -rf $bare");
        goto start;
    }

notimplementedyet avatar Jul 20 '23 08:07 notimplementedyet

Had the same issue, but the problem was actually a permissions issue on the server. The .dep folder in particular has to be owned by the user that is triggering the deployment.

After I changed the .dep folder to be owned by the user deployer, it was successfully deployed. But, the .dep folder back to www-data user. How do you think I could solve it?

syarifid avatar Nov 02 '23 14:11 syarifid

Try to understand who is making the .dep dir owned by www-data.

antonmedv avatar Nov 02 '23 14:11 antonmedv

Try to understand who is making the .dep dir owned by www-data.

Okay, I figured out the problem. Thanks

syarifid avatar Nov 03 '23 10:11 syarifid