Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tasks are now called hooks #49

Merged
merged 1 commit into from
Jul 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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