Skip to content

Commit

Permalink
fix: Fix docker-image-on-docker-host
Browse files Browse the repository at this point in the history
  • Loading branch information
stmh committed Sep 8, 2022
1 parent a53c624 commit 2a457c9
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/Method/ScriptExecutionContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public function enter(ShellProviderInterface $shell): ShellProviderInterface
break;

case self::DOCKER_IMAGE:
$working_dir = realpath($this->workingDir);
$working_dir = $shell->realPath($this->workingDir);
if (!$working_dir) {
throw new \RuntimeException(sprintf('Can\'t resolve working dir %s!', $this->workingDir));
}
Expand All @@ -140,7 +140,7 @@ public function enter(ShellProviderInterface $shell): ShellProviderInterface
sprintf('%d:%d', posix_getuid(), posix_getgid())
),
'-v',
sprintf('%s:/app', realpath($this->workingDir)),
sprintf('%s:/app', $working_dir),
];
if (!is_null($entrypoint = $this->getArgument('entryPoint'))) {
$cmd[] = sprintf('--entrypoint="%s"', $entrypoint);
Expand Down
2 changes: 1 addition & 1 deletion src/Method/YarnMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ protected function prepareCommand(HostConfig $host_config, TaskContextInterface
public function resetPrepare(HostConfig $host_config, TaskContextInterface $context)
{
$this->runCommand($host_config, $context, 'install');
$this->runCommand($host_config, $context, $host_config->get('yarn.buildCommand'));
$this->runCommand($host_config, $context, $host_config->getProperty('yarn.buildCommand'));
}

public function installPrepare(HostConfig $host_config, TaskContextInterface $context)
Expand Down
4 changes: 2 additions & 2 deletions src/ShellProvider/BaseShellProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,8 @@ public function putFileContents($filename, $data, TaskContextInterface $context)
return $this->fileOperationsHandler->putFileContents($filename, $data, $context);
}

public function realPath($filename, TaskContextInterface $context)
public function realPath($filename)
{
return $this->fileOperationsHandler->realPath($filename, $context);
return $this->fileOperationsHandler->realPath($filename);
}
}
2 changes: 1 addition & 1 deletion src/ShellProvider/DeferredFileOperations.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function putFileContents($filename, $data, TaskContextInterface $context)
return $result;
}

public function realPath($filename, $context)
public function realPath($filename)
{
$result = $this->shell->run(sprintf('realpath %s', $filename), true, false);
if ($result->failed() || count($result->getOutput()) < 1) {
Expand Down
2 changes: 1 addition & 1 deletion src/ShellProvider/FileOperationsInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ interface FileOperationsInterface
{
public function getFileContents($filename, TaskContextInterface $context);
public function putFileContents($filename, $data, TaskContextInterface $context);
public function realPath($filename, $context);
public function realPath($filename);
}
2 changes: 1 addition & 1 deletion src/ShellProvider/LocalFileOperations.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public function putFileContents($filename, $data, TaskContextInterface $context)
return file_put_contents($filename, $data);
}

public function realPath($filename, $context)
public function realPath($filename)
{
return realpath($filename);
}
Expand Down
2 changes: 1 addition & 1 deletion src/ShellProvider/NoopFileOperations.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public function putFileContents($filename, $data, TaskContextInterface $context)
return false;
}

public function realPath($filename, $context)
public function realPath($filename)
{
return $filename;
}
Expand Down
2 changes: 1 addition & 1 deletion src/ShellProvider/ShellProviderInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,5 +108,5 @@ public function getFileContents($filename, TaskContextInterface $context);

public function putFileContents($filename, $data, TaskContextInterface $context);

public function realPath($filename, TaskContextInterface $context);
public function realPath($filename);
}
2 changes: 1 addition & 1 deletion src/ShellProvider/UnsupportedFileOperations.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public function putFileContents($filename, $data, TaskContextInterface $context)
throw new \RuntimeException('putFileContents not supported in this context!');
}

public function realPath($filename, $context)
public function realPath($filename)
{
throw new \RuntimeException('realPath not supported in this context!');
}
Expand Down

0 comments on commit 2a457c9

Please sign in to comment.