fix: docker compose dependencies for pr previews

This commit is contained in:
Torsten Dittmann 2024-05-14 12:19:33 +02:00
parent b5552a216d
commit 24f923e88e

View File

@ -1665,6 +1665,9 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal
});
if ($pull_request_id !== 0) {
$services->each(function ($service, $serviceName) use ($pull_request_id, $services) {
$service->depends_on = $service->depends_on->map(function ($dependency) use ($pull_request_id) {
return $dependency . "-pr-$pull_request_id";
});
$services[$serviceName . "-pr-$pull_request_id"] = $service;
data_forget($services, $serviceName);
});