Deployer: Clone from private gitlab repo

Created on 23 Feb 2017  路  3Comments  路  Source: deployphp/deployer

| Q | A
| ----------------- | ---
| Issue Type | Question
| Deployer Version | 4.2.1
| Local Machine OS | MacOS Sierra
| Remote Machine OS | CentOS Linux 7.3.1611

Description

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.

Content of 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');

Error

error

docs needed

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...

All 3 comments

@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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

krve picture krve  路  4Comments

antonmedv picture antonmedv  路  5Comments

chouex picture chouex  路  4Comments

brunodevel picture brunodevel  路  3Comments

k-solnushkin picture k-solnushkin  路  5Comments