fix: Build log fix attempt #1
This commit is contained in:
@@ -160,7 +160,7 @@ export default async function (job) {
|
||||
});
|
||||
deployNeeded = true;
|
||||
if (configHash) {
|
||||
saveBuildLog({ line: 'Configuration changed.', buildId, applicationId });
|
||||
await saveBuildLog({ line: 'Configuration changed.', buildId, applicationId });
|
||||
}
|
||||
} else {
|
||||
deployNeeded = false;
|
||||
@@ -209,13 +209,13 @@ export default async function (job) {
|
||||
pythonVariable
|
||||
});
|
||||
else {
|
||||
saveBuildLog({ line: `Build pack ${buildPack} not found`, buildId, applicationId });
|
||||
await saveBuildLog({ line: `Build pack ${buildPack} not found`, buildId, applicationId });
|
||||
throw new Error(`Build pack ${buildPack} not found.`);
|
||||
}
|
||||
deployNeeded = true;
|
||||
} else {
|
||||
deployNeeded = false;
|
||||
saveBuildLog({ line: 'Nothing changed.', buildId, applicationId });
|
||||
await saveBuildLog({ line: 'Nothing changed.', buildId, applicationId });
|
||||
}
|
||||
|
||||
// Deploy to Docker Engine
|
||||
@@ -265,15 +265,7 @@ export default async function (job) {
|
||||
//
|
||||
}
|
||||
try {
|
||||
saveBuildLog({ line: 'Deployment started.', buildId, applicationId });
|
||||
// for await (const volume of volumes) {
|
||||
// const id = volume.split(':')[0];
|
||||
// try {
|
||||
// await asyncExecShell(`DOCKER_HOST=${host} docker volume inspect ${id}`);
|
||||
// } catch (error) {
|
||||
// await asyncExecShell(`DOCKER_HOST=${host} docker volume create ${id}`);
|
||||
// }
|
||||
// }
|
||||
await saveBuildLog({ line: 'Deployment started.', buildId, applicationId });
|
||||
const composeVolumes = volumes.map((volume) => {
|
||||
return {
|
||||
[`${volume.split(':')[0]}`]: {
|
||||
@@ -306,19 +298,12 @@ export default async function (job) {
|
||||
await asyncExecShell(
|
||||
`DOCKER_HOST=${host} docker compose --project-directory ${workdir} up -d`
|
||||
);
|
||||
|
||||
// const { stderr } = await asyncExecShell(
|
||||
// `DOCKER_HOST=${host} docker run ${envFound && `--env-file=${workdir}/.env`} ${labels.join(
|
||||
// ' '
|
||||
// )} --name ${imageId} --network ${docker.network} --restart always ${volumes.length > 0 ? volumes : ''
|
||||
// } -d ${applicationId}:${tag}`
|
||||
// );
|
||||
saveBuildLog({ line: 'Deployment successful!', buildId, applicationId });
|
||||
await saveBuildLog({ line: 'Deployment successful!', buildId, applicationId });
|
||||
} catch (error) {
|
||||
saveBuildLog({ line: error, buildId, applicationId });
|
||||
await saveBuildLog({ line: error, buildId, applicationId });
|
||||
sentry.captureException(error);
|
||||
throw new Error(error);
|
||||
}
|
||||
saveBuildLog({ line: 'Proxy will be updated shortly.', buildId, applicationId });
|
||||
await saveBuildLog({ line: 'Proxy will be updated shortly.', buildId, applicationId });
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user