Skip to content

Commit

Permalink
"docker compose" support
Browse files Browse the repository at this point in the history
  • Loading branch information
fabio-ivona committed Mar 29, 2024
1 parent 3815d32 commit 5a930e2
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion app/Commands/Log/Log.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function handle(TerminalService $terminal, DockerService $docker_service)
if(empty($service)) return 0;

return $terminal->execute([
'docker-compose',
env('DOCKER_COMPOSE_COMMAND', 'docker-compose'),
'logs',
'--follow',
'--tail=50',
Expand Down
2 changes: 1 addition & 1 deletion app/Commands/Log/LogAll.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class LogAll extends Command{
public function handle(TerminalService $terminal){

return $terminal->execute([
'docker-compose',
env('DOCKER_COMPOSE_COMMAND', 'docker-compose'),
'logs',
'--follow',
'--tail=50',
Expand Down
2 changes: 1 addition & 1 deletion app/Commands/Pull.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function handle(TerminalService $terminal){
$this->info('Pulling updated images...');

$exit_code = $terminal->execute([
'docker-compose',
env('DOCKER_COMPOSE_COMMAND', 'docker-compose'),
'pull'
]);

Expand Down
4 changes: 2 additions & 2 deletions app/Commands/Rebuild.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ public function handle(TerminalService $terminal, DockerService $docker_service)
$this->info("Rebuilding service: $service_name");

$terminal->execute([
'docker-compose',
env('DOCKER_COMPOSE_COMMAND', 'docker-compose'),
'pull',
$service_name,
]);

$terminal->execute([
'docker-compose',
env('DOCKER_COMPOSE_COMMAND', 'docker-compose'),
'up',
'-d',
'--no-deps',
Expand Down
2 changes: 1 addition & 1 deletion app/Commands/Shell.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function handle(TerminalService $terminal, DockerService $docker_service)
$this->info("Starting shell for container: $service_name");

return $terminal->execute([
'docker-compose',
env('DOCKER_COMPOSE_COMMAND', 'docker-compose'),
'exec',
$service_name,
'/bin/bash',
Expand Down
2 changes: 1 addition & 1 deletion app/Commands/Start.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function handle(DockerService $docker_service, TerminalService $terminal)

$this->task('Starting containers', function () use ($terminal) {
$command = [
'docker-compose',
env('DOCKER_COMPOSE_COMMAND', 'docker-compose'),
'up',
'-d',
];
Expand Down
2 changes: 1 addition & 1 deletion app/Commands/Stop.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function handle(TerminalService $terminal){
$this->info('Stopping containers...');

$exit_code = $terminal->execute([
'docker-compose',
env('DOCKER_COMPOSE_COMMAND', 'docker-compose'),
'down'
]);

Expand Down
6 changes: 3 additions & 3 deletions app/Containers/Container.php
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ public function execute(TerminalService $terminal, array $commands, string $inpu
{

$service_command = [
'docker-compose',
env('DOCKER_COMPOSE_COMMAND', 'docker-compose'),
'exec',
];

Expand All @@ -264,7 +264,7 @@ public function run(TerminalService $terminal, array $commands, string $input =
{

$service_command = [
'docker-compose',
env('DOCKER_COMPOSE_COMMAND', 'docker-compose'),
'run',
'--service-ports',
'--rm',
Expand All @@ -284,7 +284,7 @@ public function run(TerminalService $terminal, array $commands, string $input =
public function execute_in_shell_command_line(TerminalService $terminal, array $commands)
{
$service_command = [
'docker-compose',
env('DOCKER_COMPOSE_COMMAND', 'docker-compose'),
'exec',
$this->service_name(),
];
Expand Down
2 changes: 1 addition & 1 deletion app/Traits/ExecutesShellCommands.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function handle(DockerService $docker_service, TerminalService $terminal)
$this->info('Log into Shell');

return $terminal->execute([
'docker-compose',
env('DOCKER_COMPOSE_COMMAND', 'docker-compose'),
'run',
'--rm',
$target_service,
Expand Down

0 comments on commit 5a930e2

Please sign in to comment.