Skip to content

Commit

Permalink
fix deploy order
Browse files Browse the repository at this point in the history
  • Loading branch information
fabio-ivona committed Nov 4, 2024
1 parent a9cbaaa commit 1cb1b56
Showing 1 changed file with 20 additions and 18 deletions.
38 changes: 20 additions & 18 deletions app/Recipes/Laravel/Commands/Deploy.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,25 @@ public function handle(DockerService $docker_service, TerminalService $terminal)
return false;
}

if (!$this->task("Compiling Assets", function () use ($docker_service, $terminal) {
if ($this->is_production()) {
$commands = [
"npm",
"run",
"prod",
];
} else {
$commands = [
"npm",
"run",
"dev",
];
}
return $docker_service->service('node')->run($terminal, $commands, null, false);
})) {
return false;
}


if (!$this->task("Installing Composer packages", function () use ($docker_service, $terminal) {
if ($this->is_production()) {
Expand Down Expand Up @@ -191,24 +210,7 @@ public function handle(DockerService $docker_service, TerminalService $terminal)



if (!$this->task("Compiling Assets", function () use ($docker_service, $terminal) {
if ($this->is_production()) {
$commands = [
"npm",
"run",
"prod",
];
} else {
$commands = [
"npm",
"run",
"dev",
];
}
return $docker_service->service('node')->run($terminal, $commands, null, false);
})) {
return false;
}



if (!$this->task("Exit from Maintenance mode", function () use ($docker_service, $terminal) {
Expand Down

0 comments on commit 1cb1b56

Please sign in to comment.