Add docker compose pull command to the project.

This commit is contained in:
Travis Tomka
2018-04-14 13:36:15 -06:00
parent 0bd195e5a9
commit e9efb0e5ab
3 changed files with 75 additions and 1 deletions

View File

@@ -33,6 +33,7 @@ composer require --dev droath/robo-docker-compose
The following commands have been implemented: The following commands have been implemented:
- docker-compose up - docker-compose up
- docker-compose pull
- docker-compose exec - docker-compose exec
- docker-compose down - docker-compose down
- docker-compose start - docker-compose start

66
src/Task/Pull.php Normal file
View File

@@ -0,0 +1,66 @@
<?php
namespace Droath\RoboDockerCompose\Task;
use Droath\RoboDockerCompose\DockerServicesTrait;
/**
* Define Docker compose pull command.
*/
class Pull extends Base
{
use DockerServicesTrait;
/**
* {@inheritdoc}
*/
protected $action = 'pull';
/**
* Pull what it can and ignores images with pull failures.
*
* @return $this
*/
public function ignoreFailures()
{
$this->option('ignore-pull-failures');
return $this;
}
/**
* Pull multiple images in parallel.
*
* @return $this
*/
public function parallel()
{
$this->option('parallel');
return $this;
}
/**
* Pull without printing progress information.
*
* @return $this
*/
public function quiet()
{
$this->option('quiet');
return $this;
}
/**
* Also pull services declared as dependencies.
*
* @return $this
*/
public function includeDeps()
{
$this->option('include-deps');
return $this;
}
}

View File

@@ -31,6 +31,14 @@ trait loadTasks
return $this->task(Pause::class, $pathToDockerCompose); return $this->task(Pause::class, $pathToDockerCompose);
} }
/**
* Docker compose pull task.
*/
protected function taskDockerComposePull($pathToDockerCompose = null)
{
return $this->task(Pull::class, $pathToDockerCompose);
}
/** /**
* Docker compose start task. * Docker compose start task.
*/ */
@@ -54,5 +62,4 @@ trait loadTasks
{ {
return $this->task(Execute::class, $pathToDockerCompose); return $this->task(Execute::class, $pathToDockerCompose);
} }
} }