Add docker-compose restart command.

This commit is contained in:
Travis Tomka
2017-03-30 19:58:52 -06:00
parent 4697d956fa
commit ce1360c733
2 changed files with 41 additions and 0 deletions

33
src/Task/Restart.php Executable file
View File

@@ -0,0 +1,33 @@
<?php
namespace Droath\RoboDockerCompose\Task;
use Droath\RoboDockerCompose\DockerServicesTrait;
/**
* Define docker compose restart command.
*/
class Restart extends Base
{
use DockerServicesTrait;
/**
* {@inheritdoc}
*/
protected $action = 'restart';
/**
* Specify a shutdown timeout in seconds.
*
* @param int $timeout
* The timeout in seconds.
*
* @return self
*/
public function timeout($timeout = 10)
{
$this->option('timeout', $timeout);
return $this;
}
}

View File

@@ -22,4 +22,12 @@ trait loadTasks
{ {
return $this->task(Down::class, $pathToDockerCompose); return $this->task(Down::class, $pathToDockerCompose);
} }
/**
* Docker compose restart task.
*/
protected function taskDockerComposeRestart($pathToDockerCompose = null)
{
return $this->task(Restart::class, $pathToDockerCompose);
}
} }