0

我正在使用带有 laravel 和 rsync 配方的 Deployer PHP 来部署我的 Laravel 项目,但由于某种原因,文件storage/app夹中的文件没有从 git 分支复制到服务器上的存储文件夹。.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',
        ],
    ]);

 ...

关于这里可能出现的问题和可能的解决方案有什么想法吗?

4

1 回答 1

1

这似乎是设计使然。Deployer 将 /storage 管理为共享文件夹,因为它包含您可能希望跨版本保留的信息,例如会话、日志等。

I'm guessing the files you want moved in this way would be better off if you maintained them under /resources

于 2020-08-17T01:31:35.923 回答