If the strategies
configuration is not enough for you and you'd like to define your strategy as a PHP function, follow these steps:
-
Create your own recipe and include it in your configurations.
// config/deploy.php 'include' => [ 'recipe/my_recipe.php', ],
-
Create a new task in your recipe using the
strategy:
namespace.// recipe/my_recipe.php desc('My complex custom strategy') task('strategy:my_strategy', function() { // ... });
-
Use your new custom strategy.
// config/deploy.php // Globally... 'default' => 'my_strategy', // ... Or locally 'hosts' => [ 'domain.com' => [ 'strategy' => 'my_strategy', // ... ], ],