【发布时间】:2020-11-27 19:14:30
【问题描述】:
我正在使用带有 laravel 和 rsync 配方的 Deployer PHP 来部署我的 Laravel 项目,但由于某种原因,storage/app 文件夹中的文件没有从 git 分支复制到服务器上的 storage 文件夹。
.gitignore 设置正确,我需要同步的文件实际上在 git 中。所以问题似乎在于 Deployer 没有将文件复制到 shared/storage/app 文件夹
存储/应用程序/.gitignore:
*
!.gitignore
!public/
!public/*
!templates/
!templates/*
!templates/fonts/
!templates/fonts/*
部署者.php
<?php declare(strict_types=1);
namespace Deployer;
// Include the Laravel & rsync recipes:
require 'recipe/rsync.php';
require 'recipe/laravel.php';
...
set('rsync_src', function () {
return __DIR__ . '/www'; // My LAravel project is in a sub folder of the git branch
});
// Configuring the rsync exclusions.
add('rsync', [
'exclude' => [
'.git',
'/.env',
'/storage/framework/',
'/storage/logs/',
'/vendor/',
'/node_modules/',
'.gitlab-ci.yml',
'deploy.php',
],
]);
...
关于这里可能出现的问题和可能的解决方案有什么想法吗?
【问题讨论】:
标签: laravel rsync php-deployer