Skip to content

Commit

Permalink
Fix robo commands to use latest symfony process.
Browse files Browse the repository at this point in the history
  • Loading branch information
jonpugh committed Nov 27, 2023
1 parent 0250386 commit 22b810c
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions RoboFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
require_once 'vendor/autoload.php';

use DevShop\Component\Common\GitRepository;
use Symfony\Component\Process\Process;
use Symfony\Component\Yaml\Yaml;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Exception\RuntimeException;
Expand Down Expand Up @@ -311,7 +312,7 @@ public function build($folder = 'docker', $service = 'all', $opts = [
$docker_compose_build_opts = "";

$provision_io = new \DevShop\Component\PowerProcess\PowerProcessStyle($this->input(), $this->output());
$process = new \DevShop\Component\PowerProcess\PowerProcess("docker-compose build $docker_compose_build_opts $service", $provision_io);
$process = new Process(["docker-compose", "build", $docker_compose_build_opts, $service], $provision_io);
$process->setEnv($env_build);
$process->disableOutput();
$process->setTimeout(null);
Expand Down Expand Up @@ -792,17 +793,18 @@ public function restart() {
/**
* Enter a bash shell in the devmaster container.
*/
public function shell($user = 'aegir', $service = 'devshop.server') {

public function shell($user = 'aegir', $service = 'docker-devshop.server-1') {
if ($user) {
$process = new \Symfony\Component\Process\Process("docker-compose exec --user $user $service bash");
$process = new Process(["docker", "exec", "-ti", "--user", $user, $service, "bash"]);
}
else {
$process = new \Symfony\Component\Process\Process("docker-compose exec $service bash");
$process = new Process(["docker-compose", "exec", "-ti", $service, "bash"]);
}
$process->setTty(TRUE);
$process->setTimeout(NULL);
$process->setEnv(['COMPOSE_FILE' => './docker/docker-compose.yml']);

$this->say("Running: " . $process->getCommandLine());
$process->run();
return $process->getExitCode();
}
Expand Down

0 comments on commit 22b810c

Please sign in to comment.