Skip to content
Snippets Groups Projects
Commit f349c5cd authored by jurgenhaas's avatar jurgenhaas
Browse files

l3d#37 Add phpstan script which runs in its own docker container

parent f4f79991
No related branches found
No related tags found
No related merge requests found
Pipeline #12152 passed
#!/bin/bash
export $(cat .env | xargs)
docker run --rm -v $(php /usr/local/bin/volume.php /app) phpstan/phpstan "$@"
......@@ -16,15 +16,17 @@ function readContainerConfig() {
return [];
}
function getDockerMountSource() {
function getDockerMountSource($args) {
$currentDir = getcwd();
$destDir = (empty($args[1])) ? $currentDir : $args[1];
$container = readContainerConfig();
foreach ($container['Mounts'] as $mount) {
if (strpos($currentDir, $mount['Destination']) === 0) {
return $mount['Source'] . ':' . $mount['Destination'];
return $mount['Source'] . ':' . (empty($args[1]) ? $mount['Destination'] : $destDir);
}
}
return $currentDir . ':' . $currentDir;
return $currentDir . ':' . $destDir;
}
print(getDockerMountSource());
print(getDockerMountSource($argv));
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment