Skip to content

Commit

Permalink
Add pre-rebuild Drupal hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobSanford committed May 2, 2024
1 parent aa5ab4b commit 746e4c6
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions src/Robo/Plugin/Commands/DrupalDaemonLocalDeployCommands.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Consolidation\AnnotatedCommand\CommandData;
use Dockworker\Docker\DeployedLocalResourcesTrait;
use Dockworker\Docker\DockerComposeTrait;
use Dockworker\Docker\DockerContainerExecTrait;
use Dockworker\DockworkerDaemonCommands;
use Dockworker\IO\DockworkerIOTrait;

Expand All @@ -15,8 +16,43 @@ class DrupalDaemonLocalDeployCommands extends DockworkerDaemonCommands
{
use DeployedLocalResourcesTrait;
use DockerComposeTrait;
use DockerContainerExecTrait;
use DockworkerIOTrait;

/**
* Ensure that the local application deployment is tidied up for a restart.
*
* @hook on-event dockworker-pre-local-restart-actions
*
*/
public function preRestartDrupalActions(): void
{
$this->initDockworkerIO();
$devel_modules = [
'devel',
'devel_generate',
'devel_php',
'devel_reinstall',
'devel_node_access',
];
$command = [
'drush',
'-y',
'pmu',
];
$this->executeContainerCommand(
'local',
array_merge($command, $devel_modules),
$this->dockworkerIO,
'Disabling Development Modules',
sprintf(
"[%s] Disabling development modules: %s'...",
'local',
implode(' ', $devel_modules)
)
);
}

/**
* Informs the user of useful information after a successful deployment.
*
Expand Down

0 comments on commit 746e4c6

Please sign in to comment.