zach2825/laravel-ftp-deployment

0.0.7 2021-06-05 16:21 UTC

This package is auto-updated.

Last update: 2024-09-22 07:01:04 UTC


README

备注

安装

composer require zach2825/laravel-ftp-deployment
php artisan vendor:publish --tag=ftp-deployment

设置

config/filesystem.php 中创建一个用于部署的文件系统磁盘

        'example' => [
            'driver'   => 'ftp',
            'host'     => env('DEV_FTP_HOST'),
            'username' => env('DEV_FTP_USER'),
            'password' => env('DEV_FTP_PASS'),

            // Optional FTP Settings
            // 'port'     => 21,
            // 'root'     => env('DEV_FTP_ROOT', '/var/www/html/example'),
            // 'passive'  => true,
            // 'ssl'      => true,
            // 'timeout'  => 30,
        ],

config/ftp-deployment.php 中调整应该部署哪些文件和钩子

部署到服务器

php artisan deploy:server <servername> <--refresh=0> <--debug=1>

使用刷新来刷新数据库迁移并运行种子文件。如果未设置标志,则只运行迁移。