bilbofox/deploy-remote

Remote side of deploy tool - handling deploy requests.

Maintainers

Package info

github.com/BilboTav/DeployRemote

Type:tool

pkg:composer/bilbofox/deploy-remote

Transparency log

Statistics

Installs: 6

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

0.4 2026-08-12 18:25 UTC

This package is auto-updated.

Last update: 2026-08-12 18:26:18 UTC


README

This is a remote side of deploy tool - handling deploy requests.

Installation

App using this package is supposed to be put on server, where it listens to incoming deploy requests.

After installation by:

composer require bilbofox/deploy-remote

We should create a simple app by using the application factory from this package:

use Bilbofox\DeployRemote\AppFactory;

require_once __DIR__ . '/vendor/autoload.php';

// For example...
$rootDir = '/my/web/root';
$cryptDir = $rootDir . '/crypt';
$packsDir = __DIR__ . '/packs';

// Optional logger
$logger = new My\Psr3\Logger();

$appFactory = new AppFactory(
    rootDir: $rootDir,
    cryptDir: $cryptDir,
    packsDir: $packsDir,
);
$appFactory->setLogger($logger);
$app = $appFactory->create();
$app->run();

Parameters

Constructor parameters for AppFactory are explained here. These are the main configuration settings for the app:

  • string $rootDir - Root directory of the server, from which paths are calculated
  • string $cryptDir - Path for directory with additional files added to unpacked packs, inside should match path from root to project
  • string $packsDir - Temporary directory for unpacked packs
  • ?string $basePath = null - Basepath for application or null for autodetection
  • bool $debug = false - Debug mode on/off

Usage

App listens to POST requests at its root path. Requests are normally generated by the client-side package of this deploy tool, so there is no need to send them manually.

But for explanation purposes, here is an example of the JSON request body:

{
    "pack": "zip-pack_abcde12345.zip",
    "target": "www/projects/my-project"
}
  • pack is filename of a pack file inside $packsDir directory - it's usually copied there by client-tool.
  • target is a subpath inside $rootDir directory - leading to the target project destination.

The flow of the deployment process is then quite simple:

  1. Client-side tool copies pack with project contents via some remote method (FTP usually) to $packsDir directory on server
  2. Client-side tool sends a POST request with pack filename <pack> and target path <target> to the project.
  3. This tool unpacks pack at $packsDir/<pack> and then moves it to $rootDir/<target> directory. It also backs up the old project directory temporarily just in case.
  4. After that it adds additional files from $cryptDir/<target> directory to the project directory. For example, configuration files with sensitive data etc.
  5. And that's it! After that it simply returns HTTP 200 OK.