/LabbyBundle

LabbyBundle is Symfony2 bundle for retrieving database and assets from one stage to another.

Primary LanguagePHP

LabbyBundle

Scrutinizer Code Quality Code Coverage Build Status

LabbyBundle is Symfony2 bundle for retrieving database and assets from one stage to another.

Warning Bundle is in early stage of development.

Installation

Prerequisites

  • SSH connection to the remote server.

Add LabbyBundle by running this command

$ composer.phar require velikonja/labby-bundle "dev-master"

Enable the bundle in AppKernel

<?php
// app/AppKernel.php

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

Configure the bundle

velikonja_labby:
   password_reset: ~
#  By default it changes admin's password to admin.
#  password_reset:
#    users: [ {username: admin, password: admin}, {username: admin2, password: admin2} ]

#  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
  fs:
    maps:
      uploads: # you can define more different mappings
        src: example.com:/var/www/uploads/ # Mind the trailing slash
        dst: web/uploads/
  after: [ 'fos:elastica:populate' ] # you can specify as many commands as you want
 

Use the command to sync

Warning: before you can first sync with remote, you have to deploy the code and configuration to remote.

Sync assets and database:

$ app/console labby:sync

Sync only DB:

$ app/console labby:sync:db

Sync only assets:

$ app/console labby:sync:fs

Contributing

Install dependencies

$ composer.phar install

Run tests

$ bin/phpunit

Extra

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