Skip to content

Commit

Permalink
Merge branch 'hotfix/3.2.9'
Browse files Browse the repository at this point in the history
  • Loading branch information
stmh committed Dec 11, 2019
2 parents 0211065 + 826c632 commit 5fd59d5
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
6 changes: 6 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 3.2.9 / 2019-12-11

### Fixed:

* Harden handling of getting actual container name from a service

## 3.2.8 / 2019-12-10

### Fixed
Expand Down
20 changes: 9 additions & 11 deletions src/Method/DockerMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ public function waitForServices(HostConfig $hostconfig, TaskContextInterface $co

if (!$this->isContainerRunning($docker_config, $container_name)) {
throw new \RuntimeException(sprintf(
'Docker container %s not running, check your `host.docker.name` configuration!',
'Docker container %s is not running or could not be discovered! Check your docker config!',
$container_name
));
}
Expand Down Expand Up @@ -561,20 +561,18 @@ public static function getDockerContainerName(HostConfig $host_config, Configura
$shell = $docker_config->shell();
$cwd = $shell->getWorkingDir();
$shell->cd(self::getProjectFolder($docker_config, $host_config));
$result = $shell->run('#!docker-compose ps', true);
$result = $shell->run(sprintf('#!docker-compose ps -q %s', $composer_service), true);
$shell->cd($cwd);
$docker_name = false;
if ($result->succeeded()) {
$docker_name = $result->getOutput()[0];
$cfg = $host_config['docker'];
$cfg['name'] = $docker_name;
$host_config['docker'] = $cfg;

foreach ($result->getOutput() as $line) {
if (strpos($line, '_' . $composer_service . '_') !== false) {
list($docker_name) = explode(' ', $line);
$cfg = $host_config['docker'];
$cfg['name'] = $docker_name;
$host_config['docker'] = $cfg;

return $docker_name;
}
return $docker_name;
}

throw new \RuntimeException(sprintf(
'Could not get the name of the docker container running the service `%s`',
$composer_service
Expand Down
2 changes: 1 addition & 1 deletion src/Utilities/Utilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
class Utilities
{

const FALLBACK_VERSION = '3.2.8';
const FALLBACK_VERSION = '3.2.9';

public static function mergeData(array $data, array $override_data): array
{
Expand Down

0 comments on commit 5fd59d5

Please sign in to comment.