nur-sery/nur_src/tools/compctl/DockerComposeFile.php

29 lines
638 B
PHP
Raw Normal View History

2023-12-03 22:10:18 +04:00
<?php
namespace nur\tools\compctl;
use nur\msg;
use nur\yaml;
class DockerComposeFile {
function sync(ConfigFile $config, string $branch, bool $inplace=false): bool {
if ($inplace) return false;
[$deps, $isUrls, $notFoundUrls,
] = $config->getDeps($branch);
if ($deps !== null) {
$volumes = [];
foreach ($deps as $dep) {
$volumes[] = "$dep[url]:/var/www/$dep[projname]";
}
msg::info("A reporter dans docker-composer.yml");
yaml::dump([
"services" => [
"web" => [
"volumes" => $volumes,
],
],
]);
}
return false;
}
}