PHPackages                             soviann/deploy-tasks-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. soviann/deploy-tasks-bundle

ActiveSymfony-bundle[Database &amp; ORM](/categories/database)

soviann/deploy-tasks-bundle
===========================

One-time deploy task runner for Symfony applications

v0.4.0(1mo ago)013↓66.7%MITPHPPHP &gt;=8.2CI passing

Since Jul 17Pushed 1w agoCompare

[ Source](https://github.com/Soviann/deploy-tasks-bundle)[ Packagist](https://packagist.org/packages/soviann/deploy-tasks-bundle)[ Docs](https://github.com/Soviann/deploy-tasks-bundle)[ RSS](/packages/soviann-deploy-tasks-bundle/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (4)Dependencies (50)Versions (6)Used By (0)

DeployTasksBundle
=================

[](#deploytasksbundle)

[![CI](https://github.com/Soviann/deploy-tasks-bundle/actions/workflows/ci.yml/badge.svg)](https://github.com/Soviann/deploy-tasks-bundle/actions/workflows/ci.yml)[![Coverage](https://camo.githubusercontent.com/9bd8d0ac2618d863b1fa7a77790df11fb00fb12e0f44d00357392d1e1bfa0b23/68747470733a2f2f636f6465636f762e696f2f67682f536f7669616e6e2f6465706c6f792d7461736b732d62756e646c652f67726170682f62616467652e737667)](https://codecov.io/gh/Soviann/deploy-tasks-bundle)[![Latest Stable Version](https://camo.githubusercontent.com/df86bacca92ce65b8cc7c4c028d27245910adfdcb16ea41098999126e0550554/68747470733a2f2f706f7365722e707567782e6f72672f736f7669616e6e2f6465706c6f792d7461736b732d62756e646c652f762f737461626c65)](https://packagist.org/packages/soviann/deploy-tasks-bundle)[![License](https://camo.githubusercontent.com/c9fe4705170bc129b7501511b009c96c3a71f1f0f4a482f2a4f41f827d18313d/68747470733a2f2f706f7365722e707567782e6f72672f736f7669616e6e2f6465706c6f792d7461736b732d62756e646c652f6c6963656e7365)](https://packagist.org/packages/soviann/deploy-tasks-bundle)

A Symfony bundle for running one-time deploy tasks — data migrations, cache warmups, seed scripts — via CLI. Each task is tracked so it executes exactly once across deployments.

> **Status: pre-1.0.** Public API and configuration may change without a major-version bump until `v1.0.0`. Breaking changes bump the minor version and are documented in [`UPGRADE.md`](UPGRADE.md).

Requirements
------------

[](#requirements)

- PHP &gt;= 8.2 (&gt;= 8.4 for Symfony 8)
- Symfony 6.4 LTS, 7.x or 8.x

Installation
------------

[](#installation)

```
composer require soviann/deploy-tasks-bundle
```

With Symfony Flex, the bundle is registered automatically. Without Flex, register it manually in `config/bundles.php`:

```
return [
    // ...
    Soviann\DeployTasksBundle\SoviannDeployTasksBundle::class => ['all' => true],
];
```

### Flex recipe

[](#flex-recipe)

The bundle's [Flex recipe](https://github.com/symfony/recipes-contrib/tree/main/soviann/deploy-tasks-bundle) lives in `symfony/recipes-contrib`. When Contrib recipes are enabled, `composer require soviann/deploy-tasks-bundle` registers the bundle, publishes `config/packages/soviann_deploy_tasks.yaml`, installs the host runner (`bin/deploy-tasks-host.sh`), and adds the host-task `.gitignore` entries automatically. Flex asks once per project before running a Contrib recipe — answer yes, or enable them permanently:

```
composer config extra.symfony.allow-contrib true
```

The recipe is optional — without it, the bundle works with its default configuration, and `deploytasks:host:install` scaffolds the host runner on demand.

Alternative: dedicated recipe endpointPrefer not to enable Contrib recipes globally? The same recipe is also served from a dedicated endpoint:

```
composer config extra.symfony.endpoint --json '["https://api.github.com/repos/Soviann/flex-recipes/contents/index.json", "flex://defaults"]'
```

Quick Start
-----------

[](#quick-start)

### Creating a task

[](#creating-a-task)

```
use Soviann\DeployTasksBundle\Attribute\AsDeployTask;
use Soviann\DeployTasksBundle\DeployTaskInterface;
use Soviann\DeployTasksBundle\TaskResult;
use Symfony\Component\Console\Output\OutputInterface;

#[AsDeployTask(id: 'task_20260412143000_seed_categories', priority: 10)]
final class SeedCategoriesTask implements DeployTaskInterface
{
    public function getDescription(): string
    {
        return 'Seeds the categories table with initial data.';
    }

    public function run(OutputInterface $output): TaskResult
    {
        // Your task logic here
        $output->writeln('Categories seeded.');

        return TaskResult::SUCCESS;
    }
}
```

### Running tasks

[](#running-tasks)

Execute all pending tasks:

```
bin/console deploytasks:run
```

Check the status of all tasks:

```
bin/console deploytasks:status
```

Configuration
-------------

[](#configuration)

```
# config/packages/soviann_deploy_tasks.yaml
soviann_deploy_tasks:
    slow_task_threshold: 300     # seconds; warn when a task runs longer (nothing is killed)
    storage:
        type: filesystem         # filesystem | database | custom
        filesystem:
            path: '%kernel.project_dir%/var/deploy-tasks'
    lock:
        enabled: true
```

Full reference: [`docs/storage.md`](docs/storage.md) and [`docs/installation.md`](docs/installation.md).

Storage Backends
----------------

[](#storage-backends)

**Filesystem** (default): stores execution records as files in `var/deploy-tasks/`. No additional dependencies required.

**Database**: stores execution records in a database table. Requires `doctrine/dbal`.

**Custom**: plug in any `TaskStorageInterface` implementation via `storage.type: custom`. See [`docs/storage.md`](docs/storage.md).

Task Groups
-----------

[](#task-groups)

Tasks can be assigned to one or more groups (e.g. `predeploy`, `postdeploy`) to split a deploy into named stages. Without `--group`, every command operates on every slot — the default (ungrouped) slot and every declared group; `--group=` (repeatable) narrows to the tasks declaring the listed group(s), and a multi-group task records one row per matching slot.

```
#[AsDeployTask(id: 'task_...', groups: 'predeploy')]
#[AsDeployTask(id: 'task_...', groups: ['predeploy', 'postdeploy'])]
```

See [`docs/creating-tasks.md`](docs/creating-tasks.md#group-filtering) and [`docs/commands.md`](docs/commands.md) for details.

Host-scope tasks
----------------

[](#host-scope-tasks)

Host tasks run outside the Symfony container — useful for operations that must execute on the host (Docker restarts, SSH-driven commands, infrastructure prep). The host runner (`bin/deploy-tasks-host.sh`) is installed automatically by the Flex recipe; without it, one command scaffolds everything:

```
bin/console deploytasks:host:install
```

This installs the runner script (executable), creates the configured host-task directory (default `deploy/host-tasks/`, with a `.gitkeep`), and adds a Flex-style `.gitignore` block for the runner's log, lock, and local-override files — each step idempotent. Re-run with `--force` to refresh the runner after a bundle update. See [`docs/host-tasks.md`](docs/host-tasks.md) for generation, execution, `.env` cascade, and concurrency details.

Commands
--------

[](#commands)

CommandDescriptionOptions`deploytasks:run`Execute pending tasks`--dry-run`, `--rerun-all`, `--id=`, `--group=` (repeatable), `--require-some``deploytasks:status`List tasks with their execution state`--no-state`, `--group=` (repeatable), `--filter-status=``deploytasks:show `Show full metadata and every stored execution record for a single task—`deploytasks:skip `Mark a task as skipped (interactive confirm)`--group=` (repeatable)`deploytasks:reset `Clear the execution record for a task (interactive confirm)`--no-interaction`, `--group=` (repeatable), `--force``deploytasks:rollup`Clear history and mark all tasks as executed`--no-interaction`, `--group=` (repeatable), `--force``deploytasks:generate`Generate a blank deploy task (PHP class, runs inside the Symfony container)`--dir`, `--namespace``deploytasks:create-schema`Create the storage schema (storages implementing `SchemaManageableInterface`)`--dump-sql``deploytasks:host:install`Install the host runner, the configured host-task directory, and the `.gitignore` block (idempotent)`--force``deploytasks:host:generate`Generate a blank deploy task (bash script, runs on the host outside the container)`--dir``deploytasks:host:skip `Mark a host-scope task as done in the completion log (interactive confirm)—`deploytasks:host:reset `Remove a host-scope task's completion-log entry`--no-interaction`, `--force``deploytasks:host:rollup`Mark every pending host-scope task as done`--no-interaction`, `--force``deploytasks:host:config`Render (or write) the host runner env config matching `soviann_deploy_tasks.host.*``--write`Running shell commands
----------------------

[](#running-shell-commands)

Tasks that shell out to external binaries can opt into the `ProcessRunnerTrait`, which wraps `symfony/process` to stream output and enforce a per-call timeout. See [`docs/creating-tasks.md`](docs/creating-tasks.md#running-shell-commands) for setup and behavior notes.

Documentation
-------------

[](#documentation)

Full index: [`docs/index.md`](docs/index.md).

TopicFileInstallation, requirements, optional packages[`docs/installation.md`](docs/installation.md)Creating tasks (attributes, env/group filtering, IDs)[`docs/creating-tasks.md`](docs/creating-tasks.md)Console commands reference[`docs/commands.md`](docs/commands.md)Storage backends (filesystem, database, custom)[`docs/storage.md`](docs/storage.md)Host-scope tasks (host runner, `.env` cascade, concurrency)[`docs/host-tasks.md`](docs/host-tasks.md)Lifecycle events[`docs/events.md`](docs/events.md)Logging (PSR-3, Monolog channel)[`docs/logging.md`](docs/logging.md)Testing (unit, functional, command tester)[`docs/testing.md`](docs/testing.md)Security model, host runner hardening[`docs/security.md`](docs/security.md)Advanced (custom sorter, locking, slow-task threshold, transactions)[`docs/advanced.md`](docs/advanced.md)Troubleshooting / FAQ[`docs/troubleshooting.md`](docs/troubleshooting.md)Project meta: [`CHANGELOG.md`](CHANGELOG.md) (release notes, Keep-a-Changelog format), [`UPGRADE.md`](UPGRADE.md) (breaking-change migration notes), [`SECURITY.md`](SECURITY.md) (vulnerability disclosure), [`CONTRIBUTING.md`](CONTRIBUTING.md) (local dev setup and PR conventions).

Security
--------

[](#security)

Failure logs from DBAL-backed storage are scrubbed of full exception objects to avoid leaking connection credentials into shared log sinks. See [`docs/logging.md`](docs/logging.md#credential-safety-when-routing-the-channel) and [`docs/security.md`](docs/security.md) for the full trust model and hardening notes.

Contributing
------------

[](#contributing)

See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.

License
-------

[](#license)

MIT. See [LICENSE](LICENSE) for details.

###  Health Score

38

—

LowBetter than 82% of packages

Maintenance95

Actively maintained with recent releases

Popularity5

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 97.1% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

4

Last Release

43d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/11069018?v=4)[Ahmed Elhadi](/maintainers/Sovian)[@sovian](https://github.com/sovian)

---

Top Contributors

[![Soviann](https://avatars.githubusercontent.com/u/13745196?v=4)](https://github.com/Soviann "Soviann (428 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (13 commits)")

---

Tags

clideploy-tasksdeploymentmigrationsphpsymfonysymfony-bundlesymfonybundlemigrationdeployTasks

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/soviann-deploy-tasks-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/soviann-deploy-tasks-bundle/health.svg)](https://phpackages.com/packages/soviann-deploy-tasks-bundle)
```

###  Alternatives

[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

605.9M717](/packages/shopware-core)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.4k1.4M241](/packages/sulu-sulu)[shopware/platform

The Shopware e-commerce core

3.4k1.5M3](/packages/shopware-platform)[drupal/core-recommended

Locked core dependencies; require this project INSTEAD OF drupal/core.

7544.4M463](/packages/drupal-core-recommended)[flow-php/flow

PHP ETL - Extract Transform Load - Data processing framework

86538.6k](/packages/flow-php-flow)[contao/core-bundle

Contao Open Source CMS

1231.7M3.2k](/packages/contao-core-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
