-1

我使用部署程序包

https://deployer.org/

使用 symfony4 收据将我的 symfony5 应用程序通过 SSH 从 uberspace 部署到 Centos 服务器。

我的deploy.php样子是这样的:

<?php
namespace Deployer;

require 'recipe/symfony4.php';

// Project name
set('application', 'system.company');

// Project repository
set('repository', 'git@github.com:username/system.company.git');

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

set('ssh_multiplexing', false);

set('default_stage', 'production');

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

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


// Hosts

host('greip.uberspace.de')
    ->user('username')
    ->port(22)
    ->identityFile('C:\Users\Username\.ssh\id_rsa')
    ->forwardAgent(true)
    ->addSshOption('UserKnownHostsFile', '/dev/null')
    ->addSshOption('StrictHostKeyChecking', 'no')
    ->stage('production')
    ->set('/var/www/virtual/username/system', '~/{{application}}')
    ->set('deploy_path', '/var/www/virtual/username/system')
    ->set('http_user', 'www-data');
    
// Tasks
task('pwd', function () {
    $result = run('pwd');
    writeln("Current dir: $result");
});

task('build', function () {
    run('cd {{release_path}} && build');
});

// [Optional] if deploy fails automatically unlock.
after('deploy:failed', 'deploy:unlock');

// Migrate database before symlink new release.

before('deploy:symlink', 'database:migrate');

任务"deploy:unlock"因此异常而失败:

 [Deployer\Exception\RuntimeException (2)]
  The command "cd /var/www/virtual/username/system/releases/5 && (setfacl -L -R -m u:"httpd":rwX -m u:`whoami`:rwX var)" failed.

  Exit Code: 2 (Misuse of shell builtins)

  Host Name: greip.uberspace.de

  ================
  Warning: Permanently added 'greip.uberspace.de,2a00:d0c0:200:0:a88f:85ff:fe87:1061' (ED25519) to the list of known hosts.
  setfacl: Option -m: Invalid argument near character 3

任何人有解决它的想法吗?

4

1 回答 1

-1

找到了答案:

set('http_user', 'www-data');
set('writable_mode', 'chmod');
set('use_relative_symlink', '0');
于 2020-12-12T17:22:13.513 回答