Create Run Command

This commit is contained in:
Gordon Heydon
2018-03-08 16:03:08 +11:00
parent abd26b2b0a
commit 1a94e483fe
2 changed files with 37 additions and 0 deletions

29
src/Task/Run.php Normal file
View File

@@ -0,0 +1,29 @@
<?php
namespace Droath\RoboDockerCompose\Task;
/**
* Docker compose execute command.
*/
class Run extends Execute
{
/**
* {@inheritdoc}
*/
protected $action = 'run';
/**
* Set the workdir.
*
* @param $workdir
* The directory which to run the command under.
*
* @return $this
*/
public function setWorkDir($workdir) {
$this->option('workdir', $workdir, '=');
return $this;
}
}

View File

@@ -55,6 +55,14 @@ trait loadTasks
return $this->task(Execute::class, $pathToDockerCompose);
}
/**
* Docker compose execute task.
*/
protected function taskDockerComposeRun($pathToDockerCompose = null)
{
return $this->task(Run::class, $pathToDockerCompose);
}
/**
* Docker compose build task.
*/