Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

fix: Build log fix attempt #1

Andras Bacsai781d034484c3
diff --git a/src/lib/queues/builder.ts b/src/lib/queues/builder.ts
index be46976c5d..9af28504c6 100644
--- a/src/lib/queues/builder.ts
+++ b/src/lib/queues/builder.ts
@@ -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 });
}
}
diff --git a/src/routes/applications/[id]/logs/build/index.svelte b/src/routes/applications/[id]/logs/build/index.svelte
index 6af35e417c..da79168a7b 100644
--- a/src/routes/applications/[id]/logs/build/index.svelte
+++ b/src/routes/applications/[id]/logs/build/index.svelte
@@ -195,9 +195,11 @@
</div>
{/each}
</div>
- <div class="flex space-x-2">
- <button disabled={noMoreBuilds} class="w-full" on:click={loadMoreBuilds}>Load More</button>
- </div>
+ {#if builds.length > 0}
+ <div class="flex space-x-2">
+ <button disabled={noMoreBuilds} class="w-full" on:click={loadMoreBuilds}>Load More</button>
+ </div>
+ {/if}
</div>
<div class="flex-1 md:w-96">
{#if buildId}