codenamephp/deployer.mariadb

2.0.0 2024-01-15 08:36 UTC

This package is auto-updated.

Last update: 2024-04-15 09:09:24 UTC


README

Packagist Version Packagist PHP Version Support Lines of code GitHub code size in bytes CI Packagist Downloads GitHub

What is it?

This package adds tasks to push, pull and copy mariadb databases along with various subtasks for dumping, importing etc.

Installation

Easiest way is via composer. Just run composer require codenamephp/deployer.mariadb in your cli which should install the latest version for you.

Usage

Use the included tasks in your deployer file. You need to add the database configuration to your hosts:

$deployerFunctions->localhost()
  ->set('database', [
    'user' => 'application',
    'password' => 'application',
    'name' => 'application',
    'host' => 'database',
  ]);

All supported options are documented in the \de\codenamephp\deployer\mariadb\database\factory\database\iDatabase::fromArray interface.

For the copy tasks you need to have ssh agent forwarding enabled since the hosts try to connect directly using a local key. This key must have access to both servers. This way, the copy can work without the servers knowing about each other.