velikonja/labby-bundle

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

Installs: 6 133

Dependents: 0

Suggesters: 0

Security: 0

Stars: 4

Watchers: 1

Forks: 1

Open Issues: 0

Type:symfony-bundle

0.2.2 2016-06-01 07:09 UTC

This package is auto-updated.

Last update: 2024-03-29 03:09:11 UTC


README

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

Scrutinizer Code Quality Code Coverage Build Status

LabbyBundle is Symfony 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 "@stable"

Enable the bundle in AppKernel

<?php
// app/AppKernel.php

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

Configure the bundle

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

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

Check .travis.yml for more information about setting up test environment.

Extra

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