Skip to content

Commit 3b9f1ad

Browse files
Merge pull request #165 from magento-commerce/MCLOUD-14015
MCLOUD-14015:Cloud Docker fixes
2 parents ef78972 + a5e6beb commit 3b9f1ad

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

tests/functional/Codeception/Docker.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ public function runDockerComposeCommand(string $command): bool
108108
public function resetFilesOwner(): bool
109109
{
110110
return $this->runDockerComposeCommand(
111-
'run build bash -c "chown -R $(id -u):$(id -g) . /composer/cache"'
112-
);
111+
'run --user root build bash -c "uid=$(stat -c %u . 2>/dev/null || stat -f %u .); gid=$(stat -c %g . 2>/dev/null || stat -f %g .); chown -R $uid:$gid . /composer/cache"'
112+
);
113113
}
114114

115115
/**

tests/functional/Robo/Tasks/CopyFromDocker.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,10 @@ public function destination(string $destination): self
8080
public function getCommand(): string
8181
{
8282
return sprintf(
83-
'docker cp "$(docker-compose ps -q %s)":%s %s',
83+
'(docker-compose cp %s:%s %s) || (docker cp $(docker-compose ps -q %s):%s %s)',
84+
$this->container,
85+
$this->source,
86+
$this->destination,
8487
$this->container,
8588
$this->source,
8689
$this->destination
@@ -108,4 +111,4 @@ public function run(): Result
108111

109112
return $this->executeCommand($this->getCommand());
110113
}
111-
}
114+
}

tests/functional/Robo/Tasks/CopyToDocker.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,10 @@ public function destination(string $destination): self
8080
public function getCommand(): string
8181
{
8282
return sprintf(
83-
'docker cp "$(docker-compose ps -q %s)":%s %s',
83+
'(docker-compose cp %s:%s %s) || (docker cp $(docker-compose ps -q %s):%s %s)',
84+
$this->source,
85+
$this->container,
86+
$this->destination,
8487
$this->source,
8588
$this->container,
8689
$this->destination
@@ -102,4 +105,4 @@ public function run(): Result
102105

103106
return $this->executeCommand($this->getCommand());
104107
}
105-
}
108+
}

0 commit comments

Comments
 (0)