2017 © Pedro Peláez
 

symfony-bundle labby-bundle

Symfony bundle for retrieving database and assets from one stage to another.

image

velikonja/labby-bundle

Symfony bundle for retrieving database and assets from one stage to another.

  • Wednesday, June 1, 2016
  • by matejvelikonja
  • Repository
  • 1 Watchers
  • 4 Stars
  • 5,770 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 9 Versions
  • 0 % Grown

The README.md

LabbyBundle

Join the chat at https://gitter.im/matejvelikonja/LabbyBundle, (*1)

Scrutinizer Code Quality Code Coverage Build Status, (*2)

LabbyBundle is Symfony bundle for retrieving database and assets from one stage to another., (*3)

Warning Bundle is in early stage of development., (*4)

Installation

Prerequisites, (*5)

  • SSH connection to the remote server.

Add LabbyBundle by running this command, (*6)

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

Enable the bundle in AppKernel, (*7)

<?php
// app/AppKernel.php

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

Configure the bundle, (*8)

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"

Use the command to sync, (*9)

Warning: Before you can first sync with remote, you have to deploy the code and configuration to remote., (*10)

Sync assets and database:, (*11)

$ app/console labby:sync

Sync only DB:, (*12)

$ app/console labby:sync:db

Sync only assets:, (*13)

$ app/console labby:sync:fs

Contributing

Install dependencies, (*14)

$ composer.phar install

Run tests, (*15)

$ bin/phpunit

Check .travis.yml for more information about setting up test environment., (*16)

Extra, (*17)

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

The Versions