1

我们在同一台服务器上有多个 Laravel 应用程序。要部署,我使用具有相同deploy.php 应用程序的部署程序长时间保持旧状态,即使我在服务器上sudo service php7.1-fpm restart执行命令。sudo service nginx restart我还检查了新应用程序是否已部署并且是。在本地,一切正常。你有什么提示我可以开始搜索吗?

<?php
    namespace Deployer;

    require 'recipe/laravel.php';
    require 'recipe/npm.php';


    set('local_deploy_path', '/tmp/deployer');

    // Project name
    set('application', 'parley');

    // Project repository
    set('repository', '*****');

    // [Optional] Allocate tty for git clone. Default value is false.
    set('git_tty', true);

    set('writable_dirs', [
        'bootstrap/cache',
        'storage',
        'storage/app',
        'storage/app/public',
        'storage/framework',
        'storage/framework/cache',
        'storage/framework/sessions',
        'storage/framework/views',
        'storage/logs',
    ]);

    // Shared files/dirs between deploys 
    add('shared_files', []);
    add('shared_dirs', []);

    // Writable dirs by web server 
    add('writable_dirs', []);


    // Hosts

    host('*****')
        ->user('***')
        ->port(7881)
        ->identityFile('~/.ssh/id_rsa')
        ->set('deploy_path', '****');


    // Tasks
    task('npm:build', function () {
        run('cd {{release_path}} && npm run production');
    });

    task('deploy:composer_install', function () {
        run('cd {{release_path}} ');
        run('composer install');
    })->desc('running composer install');

    desc('Execute artisan storage:link');
    task('artisan:storage:link', function () {
        $needsVersion = 5.3;
        $currentVersion = get('laravel_version');
        if (version_compare($currentVersion, $needsVersion, '>=')) {
            run('{{bin/php}} {{release_path}}/artisan storage:link');
        }
    });


    desc('Deploy your project');
    task('deploy', [
        'deploy:prepare',
        'deploy:release',
        'deploy:update_code',
        'deploy:shared',
        'deploy:writable',
        'deploy:vendors',
        'deploy:composer_install',
        'artisan:migrate',
        //'artisan:db:seed',
        'npm:install',
        'npm:build',
        'artisan:storage:link',
        'deploy:symlink'
    ]);
4

0 回答 0