Resolve fixed-name Traefik in E2E smoke
This commit is contained in:
@@ -124,22 +124,29 @@ async function readComposeServiceHost(rootDir, composeProject, serviceName) {
|
||||
allowFailure: true,
|
||||
});
|
||||
const containerId = String(ps.stdout || "").trim().split(/\s+/).find(Boolean);
|
||||
if (!containerId) {
|
||||
return null;
|
||||
const containerRefs = [
|
||||
...(containerId ? [containerId] : []),
|
||||
serviceName,
|
||||
];
|
||||
|
||||
for (const containerRef of [...new Set(containerRefs)]) {
|
||||
const inspection = await runCommand("docker", [
|
||||
"inspect",
|
||||
"-f",
|
||||
"{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}",
|
||||
containerRef,
|
||||
], {
|
||||
cwd: rootDir,
|
||||
allowFailure: true,
|
||||
});
|
||||
const host = String(inspection.stdout || "").trim().split(/\s+/).find((value) => /^\d{1,3}(?:\.\d{1,3}){3}$/.test(value));
|
||||
|
||||
if (host) {
|
||||
return host;
|
||||
}
|
||||
}
|
||||
|
||||
const inspection = await runCommand("docker", [
|
||||
"inspect",
|
||||
"-f",
|
||||
"{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}",
|
||||
containerId,
|
||||
], {
|
||||
cwd: rootDir,
|
||||
allowFailure: true,
|
||||
});
|
||||
const host = String(inspection.stdout || "").trim().split(/\s+/).find((value) => /^\d{1,3}(?:\.\d{1,3}){3}$/.test(value));
|
||||
|
||||
return host || null;
|
||||
return null;
|
||||
}
|
||||
|
||||
async function candidateApiBaseUrls(baseUrl, rootDir, composeProject) {
|
||||
|
||||
Reference in New Issue
Block a user