Skip to content

Commit

Permalink
Tasks are now called hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
apfelbox committed Jul 5, 2024
1 parent cb45f86 commit fd3267c
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions docs/php/symfony/hosting/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -110,38 +110,34 @@ There are automatic build info integrations for the following info:



### Hooks


### Tasks

This bundle provides infrastructure for your app to run one-time tasks after build or deployment.
This bundle provides infrastructure for your app to run one-time hooks after build or deployment.

These are called using the console commands:

```shell
bin/console hosting:run-tasks:post-build
bin/console hosting:run-tasks:post-deploy
bin/console hosting:hook:build
bin/console hosting:hook:deploy
```

You can integrate into them by implementing the `PostBuildTaskInterface` or `PostDeploymentTaskInterface` interfaces respectively. Use autoconfiguration, then everything works out-of-the-box.
You can integrate into them by implementing the `BuildHookInterface` or `DeployHookInterface` interfaces respectively. Use autoconfiguration, then everything works out-of-the-box.

Every task has basically a label and a callback that can perform certain tasks:

```php
use Torr\Hosting\Deployment\PostBuildTaskInterface;
use Torr\Hosting\Deployment\BuildHookInterface;

class MyBuildTask implements PostBuildTaskInterface
class MyBuildTask implements BuildHookInterface
{
/**
* @inheritDoc
*/
public function getLabel () : string
{
return "My Task";
}

/**
* @inheritDoc
*/
public function runPostBuild (TaskCli $io) : void
{
Expand Down

0 comments on commit fd3267c

Please sign in to comment.