2017 © Pedro Peláez
 

library server-sync-bundle

A small Symfony3 bundle for syncing your project with different servers (dev, staging, prod) via rsync

image

eduardoledo/server-sync-bundle

A small Symfony3 bundle for syncing your project with different servers (dev, staging, prod) via rsync

  • Monday, November 21, 2016
  • by eduardoledo
  • Repository
  • 1 Watchers
  • 0 Stars
  • 3 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

EduardoLedoServerSyncBundle

  • Simple bundle for syncing your project with multiple servers (dev, staging, prod) via rsync.

Installation:

Step 1: Download the bundle

Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle, (*1)

$ composer require eduardoledo/server-sync-bundle

Step 2: Enable the bundle in AppKernel.php

// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new EduardoLedo\ServerSyncBundle(),
    );
}

Step 3: Configure the bundle

# app/config/parameters.yml
parameters:
    ...

eduardo_ledo_server_sync:
    servers:
        myserver:
            user: myuser                            # optional
            password: mypassword                    # optional
            host: host.example.com                  # required
            destination_dir: /home/myuser/dest_dir  # required
            exclude:                                # optional
                - dir1
                - dir2/*
                - dir3/*.ext
            exclude-from:                           # optional
                - file1
                - file2
                - fileN

Usage:

You can list the configured servers from the console:, (*2)

$ bin/console eduardoledo:server-sync:list-servers

This will output something like:, (*3)


+------+------------+--------+--------+--------------------------+ | Name | Host | User | Pass | Dest. dir | +------+------------+--------+--------+--------------------------+ | dev | localhost | | | /var/www/mysite.dev/ | | prod | mysyte.com | myuser | mypass | /home/myuser/mysyte.com/ | +------+------------+--------+--------+--------------------------+

Then you can: - Perform a dry run:, (*4)

$ bin/console eduardoledo:server-sync:upload --server=dev --dry-run
  • Upload the files to one server:
$ bin/console eduardoledo:server-sync:upload --server=dev
  • Upload the files to multiple servers:
$ bin/console eduardoledo:server-sync:upload --server=dev --server=prod

The Versions

21/11 2016

dev-master

9999999-dev

A small Symfony3 bundle for syncing your project with different servers (dev, staging, prod) via rsync

  Sources   Download

MIT