| Q | A
| ----------------- | ---
| Issue Type | Question
| Deployer Version | 4.2.1
| Local Machine OS | MacOS Sierra
| Remote Machine OS | CentOS Linux 7.3.1611
I am trying to use with private repo. Deployer can reach server and create directory structure but can't clone files from private gitlab repo.
deploy.php<?php
namespace Deployer;
require 'recipe/common.php';
// Configuration
set('ssh_type', 'native');
set('ssh_multiplexing', true);
set('repository', '[email protected]:coderontheroad/**********.git');
set('shared_files', []);
set('shared_dirs', []);
set('writable_dirs', []);
// Servers
server('production', '*.*.*.*')
->user('****')
->identityFile()
->set('deploy_path', '/home/****/****/****');
// Tasks
desc('Restart PHP-FPM service');
task('php-fpm:restart', function () {
// The user must have rights for restart service
// /etc/sudoers: username ALL=NOPASSWD:/bin/systemctl restart php-fpm.service
run('sudo systemctl restart php-fpm.service');
});
after('deploy:symlink', 'php-fpm:restart');
desc('Deploy your project');
task('deploy', [
'deploy:prepare',
'deploy:lock',
'deploy:release',
'deploy:update_code',
'deploy:shared',
'deploy:writable',
'deploy:vendors',
'deploy:clear_paths',
'deploy:symlink',
'deploy:unlock',
'cleanup',
'success'
]);
// [Optional] if deploy fails automatically unlock.
after('deploy:failed', 'deploy:unlock');

@coderontheroad Try to run git clone on the server manually. Did you set a deploy key in the repo and add it on the server?
@pluseg I already added deploy key but I didn't execute any git clone command. So I tried to execute and it works but i noticed that, server asked add gitlab to (ECDSA) to the list of known hosts. And I said yes. Than deploy comment started to work now :) Thanks...
@pluseg it will be good to add this to docs, ...will help a lot of people.
Most helpful comment
@pluseg I already added deploy key but I didn't execute any git clone command. So I tried to execute and it works but i noticed that, server asked add gitlab to (ECDSA) to the list of known hosts. And I said yes. Than deploy comment started to work now :) Thanks...