https://github.com/znmin/laravel-deployer
laravel 支持 git hook 的自动部署
https://github.com/znmin/laravel-deployer
deployer laravel
Last synced: 4 days ago
JSON representation
laravel 支持 git hook 的自动部署
- Host: GitHub
- URL: https://github.com/znmin/laravel-deployer
- Owner: znmin
- Created: 2019-12-06T08:07:10.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-12-19T17:31:01.000Z (about 6 years ago)
- Last Synced: 2025-07-27T08:26:10.369Z (6 months ago)
- Topics: deployer, laravel
- Language: PHP
- Homepage:
- Size: 25.4 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Laravel Deployer
[](https://travis-ci.org/znmin/laravel-deployer)

## 依赖
* PHP >= 7.1
## 安装
```shell
$ composer require znmin/laravel-deployer
```
composer 安装之后,如果 Laravel 版本 < 5.5,则需要注册服务提供者
```php
// config/app.php
'providers' => [
//...
Znmin\LaravelDeployer\ServiceProvider::class,
],
```
发布配置文件
```shell
$ php artisan vendor:publish --provider=Znmin\LaravelDeployer\ServiceProvider
```
配置
```php
/*
|--------------------------------------------------------------------------
| 默认部署驱动
|--------------------------------------------------------------------------
|
| 指定默认的部署驱动
| 可选择的驱动:expect
|
*/
'default' => 'expect',
'drives' => [
/*
* expect 驱动配置
*/
'expect' => [
'username' => env('DEPLOY_EXPECT_USERNAME', ''),
'password' => env('DEPLOY_EXPECT_PASSWORD', ''),
'branch' => env('DEPLOY_EXPECT_BRANCH', 'master'),
'remote' => 'origin',
],
],
```
## 使用
使用 expect 驱动需在部署服务器安装此命令:
Ubuntu
```shell
$ apt install expect
```
CentOS
```shell
$ yum install expect
```
配置码云 webhook
```shell
码云钩子
https://example.com/git-hook/gitee
```
`https://example.com` 替换为真实域名即可