velikonja/labby-bundle

用于从一个阶段检索数据库和资源到另一个阶段的Symfony扩展包。

安装次数: 6,133

依赖项: 0

建议者: 0

安全: 0

星标: 4

关注者: 1

分支: 1

公开问题: 0

类型:symfony-bundle

0.2.2 2016-06-01 07:09 UTC

This package is auto-updated.

Last update: 2024-08-29 04:12:50 UTC


README

Join the chat at https://gitter.im/matejvelikonja/LabbyBundle

Scrutinizer Code Quality Code Coverage Build Status

LabbyBundle是一个用于从一个阶段检索数据库和资源到另一个阶段的Symfony扩展包。

警告 扩展包处于早期开发阶段。

安装

先决条件

  • 远程服务器的SSH连接。

运行以下命令添加LabbyBundle

$ composer.phar require velikonja/labby-bundle "@stable"

在AppKernel中启用扩展包

<?php
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new Velikonja\LabbyBundle\VelikonjaLabbyBundle(),
    );
}

配置扩展包

velikonja_labby:
#  process_timeout: 300    # Timeout for each external process run (import, dump, ssh, scp, ...).
#  roles: [ remote, local ]

  remote:
    hostname: example.com  # Server where the remote is hosted. 
    path:     /var/www/app # Path to application on remote.
#   env:      prod         # SF env to be run on remote (default true)

  fs:
#   timeout: 60            # Number of seconds in which one mapping (not all of them) sync timeouts.
    maps:                  # You can define more different mappings
      uploads: 
        src: example.com:/var/www/uploads/ # Mind the trailing slash
        dst: web/uploads/
      data:
        src: example.com:/var/www/data/
        dst: app/data/
        
# db:
#   recreate:             true # By default this value is true

# Following options are automatically fetched from doctrine.dbal configuration.
#   driver:               ~
#   dbname:               ~
#   host:                 ~
#   port:                 ~
#   user:                 ~
#   password:             ~
#   charset:              ~

# Run commands (symfony or shell) on certain events.
#  event_executors:
#    pre_sync:
#      - shell: "whoami"
#    post_sync:
#      - sf: "cache:clear"
#    post_sync.db:
#      - sf: "fos:user:change-password admin admin"

使用命令进行同步

警告: 在您第一次与远程同步之前,您必须将代码和配置部署到远程服务器。

同步资源和数据库

$ app/console labby:sync

仅同步数据库

$ app/console labby:sync:db

仅同步资源

$ app/console labby:sync:fs

贡献

安装依赖项

$ composer.phar install

运行测试

$ bin/phpunit

检查.travis.yml以获取有关设置测试环境更多信息。

额外

$ bin/phpmd . text cleancode, codesize, controversial, design, naming, unusedcode --exclude vendor/
$ bin/phpcpd . --exclude=vendor