我使用Deployer和laravel和rsync食谱来部署我的Laravel项目,但出于某种原因,storage/app
文件夹中的文件没有从git分支复制到服务器上的存储文件夹。.gitignore设置正确,我需要同步的文件实际上在git中。因此,问题似乎在于Deployer没有将文件复制到shared/storage/app
文件夹
存储/app/..gitignore:
*
!.gitignore
!public/
!public/*
!templates/
!templates/*
!templates/fonts/
!templates/fonts/*
deployer.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',
],
]);
...
关于这个问题和可能的解决办法,有什么想法吗?
发布于 2020-08-16 17:31:35
这似乎是故意的。部署人员将/storage管理为共享文件夹,因为它包含您可能希望跨版本保留的信息,如会话、日志等。
我猜如果您在/resources下维护这些文件,以这种方式移动它们会更好。
https://stackoverflow.com/questions/63301973
复制