1

We have several Laravel applications on the same server. To deploy, i use deployer with the same deploy.php One application remains longtime in the old status, even i execute the commands sudo service php7.1-fpm restartand sudo service nginx restarton the server. I checked also if the new application is deployed and it is. On local, everything works well. Do you have a hint where I can start to search?

<?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'
    ]);
Cœur
  • 37,241
  • 25
  • 195
  • 267
Peter
  • 655
  • 1
  • 14
  • 37
  • Browser cache maybe? – Camilo Sep 01 '18 at 21:05
  • Are you sure it's the whole App that's running in a previous state? If you have a Queue, it may need to be restarted. You may also need to add `composer dumpautoload;composer install` to your deployment hooks, if any recent changes involved package dependencies. – kmuenkel Sep 01 '18 at 21:55
  • Looks like cache issue. Can you post the deploy script so to check which steps (and order) you are performing? – alariva Sep 02 '18 at 02:27
  • @Camilo I deleted the browser cache – Peter Sep 03 '18 at 13:15
  • 1
    @alariva i added the deploy file – Peter Sep 03 '18 at 13:15
  • 1
    Thanks @peter, where in your script are you pulling or cloning the updated codebase ? (Just to confirm). Also, you may want to run the following commands at the end of deploy cycle: `php artisan view:clear`, `php artisan cache:clear` to make sure you refresh cached view partials and other stored values. – alariva Sep 03 '18 at 14:35
  • When i delete manually the views in `storage/framework/view` the application runs. I don't know why `php artisan view:clear` doesn't work – Peter Sep 09 '18 at 16:50

0 Answers0