amcolin / gitee-update
gitee
dev-master
2023-05-12 03:31 UTC
This package is not auto-updated.
Last update: 2025-06-22 08:18:32 UTC
README
介绍
gitee更新代码后,网站自动更新代码
使用说明
composer require amcolin/gitee-update
加入app.php providers 数组中
\Amcolin\GiteeUpdate\GiteeUpdateProvider::class
生成gitee.php配置文件
php artisan vendor:publish --provider="Amcolin\GiteeUpdate\GiteeUpdateProvider"
配置
return [
'password' => '' , // GIT钩子密码
'nginxUser' => 'www' , // nginx用哪个用户跑
'userGroup' => 'www' , // 用户所在组
];
常见问题
代码部署在docker中怎么用?
1.进入容器,查看代码文件所属用户。假设是nginx 2.先切换到nginx这个用户身份
su nginx
3.保存git密码
git config --global credential.helper store
4.执行 git pull 如果提示:
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.
git pull <remote> <branch>
If you wish to set tracking information for this branch you can do so with:
git branch --set-upstream-to=origin/<branch> master
执行 `
git branch --set-upstream-to=origin/master master`
5.正常输入用户名和密码后,就可以使用了
如何检查是否成功更新
默认日志文件在 laravel.log中
tail -n 100 -f laravel.log | grep 'gitUpdate'