部署程序-从git服务器部署到同一主机(localhost)

时间:2018-08-12 23:34:16

标签: php git deployment localhost

我在本地配置了部署器。我还创建了远程git服务器。我将代码部署到与git服务器相同的服务器上,因此也要部署到其本地主机上。

该操作执行没有错误,并且在其末尾具有成功的完整信息,但是此时不更新文件。如果在deploy.php文件中未指定localhost而是服务器主机名,则实际上已执行了推送过程。然后我将其更改为localhost,问题出现了。如何实现与本地主机的双重部署?这是deploy.php文件:

s@lokal:~/Dropbox/hosts$ cat deploy.php
<?php
namespace Deployer;

require 'recipe/common.php';

// Project name
set('application', 'hosts');

// Project repository
set('repository', 'git@gitadam.ga:trzczy/hosts.git');

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

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

// Writable dirs by web server 
set('writable_dirs', []);
set('allow_anonymous_stats', false);

// Hosts

localhost()
    ->user('deployer')
    ->set('deploy_path', '/var/www/html/hosts/production');

// Tasks

desc('Deploy your project');
task('deploy', [
    'deploy:info',
    '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');
s@lokal:~/Dropbox/hosts$ 

0 个答案:

没有答案