dev-master
9999999-devA small Symfony3 bundle for syncing your project with different servers (dev, staging, prod) via rsync
MIT
by Eduardo Ledo
Wallogit.com
2017 © Pedro Peláez
A small Symfony3 bundle for syncing your project with different servers (dev, staging, prod) via rsync
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
// app/AppKernel.php
public function registerBundles()
{
$bundles = array(
// ...
new EduardoLedo\ServerSyncBundle(),
);
}
# 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
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
$ bin/console eduardoledo:server-sync:upload --server=dev
$ bin/console eduardoledo:server-sync:upload --server=dev --server=prod
A small Symfony3 bundle for syncing your project with different servers (dev, staging, prod) via rsync
MIT