orphans / git-deploy-laravel

Helps automate the deployment of projects onto servers by utilising Git's web hooks.
MIT License
34 stars 14 forks source link

"pull" command is never fired but laravel log says it is #12

Closed flaird closed 5 years ago

flaird commented 6 years ago

So I've gone through some initial setup and fixed the secret_header and secret_key and that seems to be working. I'm getting a 200 OK response with "true" as post body when a push event is triggered from GitLab.

The storage/logs/laravel.log says this so it should be doing a "git pull":

[2018-06-23 16:04:26] local.INFO: Gitdeploy: putting site into maintenance mode
[2018-06-23 16:04:26] local.INFO: Gitdeploy: Pulling latest code on to server
[2018-06-23 16:04:26] local.INFO: Gitdeploy: taking site out of maintenance mode
[2018-06-23 16:04:26] local.DEBUG: Gitdeploy: Event GitDeployed fired

I've even tried doing /usr/bin/git --git-dir='/var/www/project-name/.git' --work-tree='/var/www/project-name' pull origin master as that is the command the package is running and that works.

The problem is that the "pull" command is never fired. If I do a "git pull" it pulls the latest changes but the package does nothing. I've tried checking permissions and modifying them but to no effect.

What am I doing wrong here? Is there something I can do to log more data?

Muffinman commented 6 years ago

Sorry I missed the email for this issue somehow...

I notice your webroot is the default /var/www/... Can you confirm your PHP executing is running with the same user/group as owned by your website files. You can test this with a quick script like:

<?php
echo system('whoami');
die;

If there is a permissions error the package will still try to execute the git command, but it may fail silently. It also probably won't be able to write you out any logs to it's own log file.

The only other thing I can think of is if the git binary is not detected and path has not been set manually in config, however I think you would see some log output for this.

Muffinman commented 5 years ago

Closing this for now... feel free to re-open if you're still having the problem.