-
Deployer Versionv7.5.4 Target OSUnbuntu 22.04 Which PHP version are you using?PHP 8.3 Content of deploy.php or deploy.yaml<?php
namespace Deployer;
require 'recipe/laravel.php';
require_once 'contrib/npm.php';
require_once 'contrib/cachetool.php';
// Config //////////////////////////////////////////////////////////////////////
set('repository', '****');
set('keep_releases', 3);
set('cachetool_url', 'https://github.com/gordalina/cachetool/releases/latest/download/cachetool.phar');
set('ssh_arguments', ['-o StrictHostKeyChecking=no', '-o UserKnownHostsFile=/dev/null']);
set('new_deployment', false);
add('shared_files', ['auth.json']);
add('shared_dirs', []);
add('writable_dirs', []);
// Hosts ///////////////////////////////////////////////////////////////////////
$envs = [
'preprod' => [
'host' => '****',
'port' => ****,
'branch' => 'develop',
'deploy_path' => '****',
'remote_user' => '****',
'http_user' => '****',
'http_group' => '****',
'private_identity' => '~/.ssh/id_rsa_deployer',
'cachetool' => '/var/run/php/php8.3-fpm.sock',
],
'production' => [
'host' => '****',
'port' => ****,
'branch' => 'main',
'deploy_path' => '****',
'remote_user' => '****',
'http_user' => '****',
'http_group' => '****',
'private_identity' => '~/.ssh/id_rsa_deployer',
'cachetool' => '/var/run/php/php8.3-fpm.sock',
],
];
foreach ($envs as $env => $config) {
host($env)
->setHostname($config['host'])
->setPort($config['port'])
->setRemoteUser($config['remote_user'])
->setDeployPath($config['deploy_path'])
->setIdentityFile($config['private_identity'])
->set('http_user', $config['http_user'])
->set('http_group', $config['http_group'])
->set('branch', $config['branch'])
->set('cachetool', $config['cachetool']);
}
// Tasks ///////////////////////////////////////////////////////////////////////
task('npm:build', fn () => run('cd {{release_path}} && {{bin/npm}} run prod'));
// Hooks ///////////////////////////////////////////////////////////////////////
after('deploy:vendors', 'npm:install');
after('npm:install', 'npm:build');
after('npm:build', 'artisan:queue:restart');
after('artisan:queue:restart', 'artisan:horizon:terminate');
after('deploy:symlink', 'cachetool:clear:opcache');
after('deploy:failed', 'deploy:unlock'); Steps to reproduceDeploy to existing server with previous The test As a result, the I would recommend to improve to the detection of the |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 6 replies
-
Yes! Could you please try this task with
|
Beta Was this translation helpful? Give feedback.
-
+1 🐞 |
Beta Was this translation helpful? Give feedback.
Fixed.