Create Run Command
This commit is contained in:
29
src/Task/Run.php
Normal file
29
src/Task/Run.php
Normal 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;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -55,6 +55,14 @@ trait loadTasks
|
|||||||
return $this->task(Execute::class, $pathToDockerCompose);
|
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.
|
* Docker compose build task.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user