我正在将我的项目从 Deployer v6 迁移到 Deployer v7。我的服务器有几个使用无密码部署密钥的项目,在尝试部署我的项目时,尽管我在服务器上的 SSH 配置文件是正确的并且最初能够部署在 Deployer 6 上,但我收到以下错误。
我不认为这是一个 Deployer 特定的问题,而是一些 SSH 配置问题,我错过了什么?
我的config
文件是:
Host fudge-api
Hostname github.com
IdentityFile /root/.ssh/fudge_api_id_ed25519
我的deploy.php
文件:
<?php
namespace Deployer;
require 'recipe/laravel.php';
require 'contrib/npm.php';
// Project repository
set('repository', 'git@github.com:company/fudge-api.git');
// [Optional] Sets the user for the web server.
set('http_user', 'root');
// Shared files/dirs between deploys
add('shared_files', ['.env']);
add('shared_dirs', ['storage', 'vendor', 'node_modules']);
// Set number of releases to keep
set('keep_releases', 3);
// Writable dirs by web server
set('allow_anonymous_stats', false);
// Fudge API (Production)
host('my ipv6 server')
->set('labels', ['stage' => 'production'])
->set('repository', 'git@fudge-api:company/fudge-api')
->set('branch', 'main')
->set('remote_user', 'root')
->set('deploy_path', '/var/www/fudge-api');
// Composer install
task('deploy:fudge_api_composer_install', function () {
run('cd {{release_path}} &&
composer install --optimize-autoloader --no-dev
');
});
// run custom task
after('deploy:vendors', 'deploy:fudge_api_composer_install');
// [Optional] if deploy fails automatically unlock.
after('deploy:failed', 'deploy:unlock');
最后,确切的错误:
[IPV6] run ssh-keygen -F fudge-api:22 || ssh-keyscan -p 22 -H fudge-api >> ~/.ssh/known_hosts
[IPV6] err getaddrinfo fudge-api: Name or service not known
[IPV6] err getaddrinfo fudge-api: Name or service not known
[IPV6] err getaddrinfo fudge-api: Name or service not known
[IPV6] exit code 1 (General error)