使用Deployer.org将Symfony3项目部署到prod服务器

时间:2016-07-13 17:55:57

标签: deployment symfony php-deployer

我正在尝试使用deployer.ord将我的symfony3项目部署到生产服务器。我已经四处走动deployer.org,不知道出了什么问题。以下是我的deploy.php文件

<?php
/*
 * This file has been generated automatically.
 * Please change the configuration for correct use deploy.
 */

require 'recipe/symfony.php';

// Set configurations
set('repository', 'git@github.com:XXXXXX/YYYYYY');
set('shared_files', ['app/config/parameters.yml']);
set('shared_dirs', ['app/logs']);
set('writable_dirs', ['app/cache', 'app/logs']);

// Configure servers
server('production', 'dummysite.com', '21')
    ->user('2136439')
    ->password('123456')
    ->env('deploy_path', '/home/www/dummysite.com/web')
    ->stage('production');

/**
 * Restart php-fpm on success deploy.
 */
task('php-fpm:restart', function () {
    // Attention: The user must have rights for restart service
    // Attention: the command "sudo /bin/systemctl restart php-fpm.service" used only on CentOS system
    // /etc/sudoers: username ALL=NOPASSWD:/bin/systemctl restart php-fpm.service
    run('sudo /bin/systemctl restart php-fpm.service');
})->desc('Restart PHP-FPM service');

after('success', 'php-fpm:restart');


/**
 * Attention: This command is only for for example. Please follow your own migrate strategy.
 * Attention: Commented by default.  
 * Migrate database before symlink new release.
 */

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

我得到的错误是:PHP Notice: Connection terminated by the server

我已经尝试过这个资源,但仍然没有运气 http://www.issart.com/blog/deployment-of-symfony2-application-using-deployer/

我想知道我是否正在使用正确的凭据(我正在使用ftp)进行部署。

我也无法在deployer.org上找到大量有关信息的信息,并逐步介绍如何进行部署和调试,以便对任何帮助表示高度赞赏。

1 个答案:

答案 0 :(得分:0)

过一会儿:)

<?php
namespace Deployer;

require 'recipe/symfony3.php';

详细信息:https://github.com/deployphp/deployer/blob/master/recipe/symfony3.php