2017 © Pedro Peláez
 

symfony-bundle sync-content-bundle

Symfony BFOSSyncContentBundle

image

brazilianfriendsofsymfony/sync-content-bundle

Symfony BFOSSyncContentBundle

  • Monday, March 20, 2017
  • by ribeiro.paulor
  • Repository
  • 2 Watchers
  • 3 Stars
  • 2,153 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 6 Versions
  • 0 % Grown

The README.md

The BFOSSyncContentBundle

This Symfony 2 bundle helps you synchronize your content with your remote server. It also deploys your application., (*1)

This bundle was inspired by sfSyncContentPlugin by Punk'Ave and MadalynnPlumBundle., (*2)

Installation

You need to install de submodule on the deps file::, (*3)

// deps
[BFOSSyncContentBundle]
    git=git://github.com/BrazilianFriendsOfSymfony/BFOSSyncContentBundle.git
    target=/bundles/BFOS/SyncContentBundle

And then::, (*4)

bash$ php bin/vendors install

Configuration

Add this to app/autoload.php::, (*5)

// app/autoload.php
$loader->registerNamespaces(array(
  // ...
  'BFOS'              => __DIR__.'/../vendor/bundles',
  // ...
));

And this to app/AppKernel.php::, (*6)

// app/AppKernel.php
if (in_array($this->getEnvironment(), array('dev', 'test'))) {
    $bundles[] = new BFOS\SyncContentBundle\BFOSSyncContentBundle();
}

And this to your app/config/config_dev.yml, (*7)

bfos_sync_content:
    options: # Global options
        deployment:
            rsync_exclude: 
                - "%kernel.root_dir%/config/rsync_exclude.txt"
            pre_local_commands:
                - 'php app/console assetic:dump'
            post_local_commands:
                - 'rm -rf web/js web/css'
            #pre_remote_commands:
            #    - './c'
            post_remote_commands:
                - 'php app/console cache:clear --env=prod --no-debug --no-warmup'
                - 'php app/console doctrine:schema:update --force --env=prod'
                - 'php app/console assets:install web --symlink'
        sync_content:
            content:
                - "web/uploads"
    servers: "%kernel.root_dir%/config/deployment_sync_content.yml"

Example of deployment_sync_content.yml :, (*8)

servers:
    staging:
        host: staging.mysite.com
        port: 22
        user: mysite
        dir: /home/user/mysite
        options : # Server options, override the globals
            rsync_options: '-azC --force --delete --verbose --progress'
            deployment:
                rsync_exclude: 
                    - "%kernel.root_dir%/config/rsync_exclude.txt"
    production:
        host: www.mysite.com
        port: 22
        user: mysite
        dir: /home/user/mysite
        options : # Server options, override the globals
            rsync_options: '-azC --force --delete --verbose --progress'
            deployment:
                rsync_exclude: 
                    - "%kernel.root_dir%/config/rsync_exclude.txt"
                    - "%kernel.root_dir%/config/rsync_exclude_prod.txt"

Example of rsync_exclude.txt :, (*9)

# Project files
# rsync doesn't need this explicit rule, but our cloud deployment tools do
*/.svn/*
/web/uploads/*
/web/bundles/*
/app/cache/*
/app/logs/*
/web/*_dev.php
# Separate version on the server allows both prod and dev to be tested locally with the
# local one. Neither version is checked into svn for security reasons since this is a public repo
/app/config/parameters.yml
/app/config/deployment_sync_content.yml
/app/config/parameters.ini

# SCM files
.arch-params
.bzr
_darcs
.git
.hg
.monotone
.svn
.idea
CVS

Usage

How to use:, (*10)

php app/console bfos:sync-content:to dev@staging, (*11)

php app/console bfos:sync-content:to prod@production, (*12)

php app/console bfos:deploy staging, (*13)

The Versions

20/03 2017

dev-master

9999999-dev http://www.duocriativa.com.br/bfos

Symfony BFOSSyncContentBundle

  Sources   Download

MIT

The Requires

 

The Development Requires

by Paulo Roberto Ribeiro

deployment management

07/07 2014

v1.0.4

1.0.4.0 http://www.duocriativa.com.br/bfos

Symfony BFOSSyncContentBundle

  Sources   Download

MIT

The Requires

 

The Development Requires

by Paulo Roberto Ribeiro

deployment management

07/07 2014

v1.0.3

1.0.3.0 http://www.duocriativa.com.br/bfos

Symfony BFOSSyncContentBundle

  Sources   Download

MIT

The Requires

 

The Development Requires

by Paulo Roberto Ribeiro

deployment management

07/07 2014

v1.0.2

1.0.2.0 http://www.duocriativa.com.br/bfos

Symfony BFOSSyncContentBundle

  Sources   Download

MIT

The Requires

 

The Development Requires

by Paulo Roberto Ribeiro

deployment management

07/07 2014

1.0.1

1.0.1.0 http://www.duocriativa.com.br/bfos

Symfony BFOSSyncContentBundle

  Sources   Download

MIT

The Requires

 

The Development Requires

by Paulo Roberto Ribeiro

deployment management

04/02 2013

v0.10.0

0.10.0.0 http://www.duocriativa.com.br/bfos

Symfony BFOSSyncContentBundle

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

by Paulo Roberto Ribeiro

deployment management