fixed prepare-job for docker to allow for no job container

This commit is contained in:
Nikola Jokic
2022-06-10 11:56:10 +02:00
parent 7ae8942b3d
commit bf362ba0dd
3 changed files with 30 additions and 14 deletions

View File

@@ -94,7 +94,10 @@ export async function prepareJob(
)
}
const isAlpine = await isContainerAlpine(containerMetadata!.id)
let isAlpine = false
if (containerMetadata?.id) {
isAlpine = await isContainerAlpine(containerMetadata.id)
}
if (containerMetadata?.id) {
containerMetadata.ports = await containerPorts(containerMetadata.id)
@@ -105,7 +108,10 @@ export async function prepareJob(
}
}
const healthChecks: Promise<void>[] = [healthCheck(containerMetadata!)]
const healthChecks: Promise<void>[] = []
if (containerMetadata) {
healthChecks.push(healthCheck(containerMetadata))
}
for (const service of servicesMetadata) {
healthChecks.push(healthCheck(service))
}