Open iantearle opened 6 years ago
I'm not sure if there's an official way, but I can think of two:
connections
folder inside .rocketeer
and a new folder for each connection, then place a hooks.php
inside each with the specific rules (example: .rocketeer/connections/staging/hooks.php
). I haven't tried it for hooks but I do it for SCM with all my projects and it works perfectly.getConnection()
inside a Task
. So for instance, in anafter-deploy
hook you can do this:
'after' => [
'deploy' => [
function ($task) {
$env = $task->connections->getConnection();
if ($env === "staging") {
// do staging-specific stuff
}
}
],
],```
Is it possible to define different hooks for each connection?