Add docker-compose restart command.
This commit is contained in:
33
src/Task/Restart.php
Executable file
33
src/Task/Restart.php
Executable 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;
|
||||
}
|
||||
}
|
||||
@@ -22,4 +22,12 @@ trait loadTasks
|
||||
{
|
||||
return $this->task(Down::class, $pathToDockerCompose);
|
||||
}
|
||||
|
||||
/**
|
||||
* Docker compose restart task.
|
||||
*/
|
||||
protected function taskDockerComposeRestart($pathToDockerCompose = null)
|
||||
{
|
||||
return $this->task(Restart::class, $pathToDockerCompose);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user