@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "coolify",
|
"name": "coolify",
|
||||||
"description": "An open-source & self-hostable Heroku / Netlify alternative.",
|
"description": "An open-source & self-hostable Heroku / Netlify alternative.",
|
||||||
"version": "2.0.2",
|
"version": "2.0.3",
|
||||||
"license": "AGPL-3.0",
|
"license": "AGPL-3.0",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "docker-compose -f docker-compose-dev.yaml up -d && NODE_ENV=development svelte-kit dev --host 0.0.0.0",
|
"dev": "docker-compose -f docker-compose-dev.yaml up -d && NODE_ENV=development svelte-kit dev --host 0.0.0.0",
|
||||||
|
|||||||
@@ -37,6 +37,9 @@ if (dev) {
|
|||||||
export const prisma = new PrismaClient(prismaOptions);
|
export const prisma = new PrismaClient(prismaOptions);
|
||||||
|
|
||||||
export function PrismaErrorHandler(e) {
|
export function PrismaErrorHandler(e) {
|
||||||
|
if (e! instanceof Error) {
|
||||||
|
e = new Error(e.toString());
|
||||||
|
}
|
||||||
sentry.captureException(e);
|
sentry.captureException(e);
|
||||||
const payload = {
|
const payload = {
|
||||||
status: e.status || 500,
|
status: e.status || 500,
|
||||||
|
|||||||
@@ -122,7 +122,9 @@ buildWorker.on('completed', async (job: Bullmq.Job) => {
|
|||||||
} finally {
|
} finally {
|
||||||
const workdir = `/tmp/build-sources/${job.data.repository}/${job.data.build_id}`;
|
const workdir = `/tmp/build-sources/${job.data.repository}/${job.data.build_id}`;
|
||||||
await asyncExecShell(`rm -fr ${workdir}`);
|
await asyncExecShell(`rm -fr ${workdir}`);
|
||||||
await asyncExecShell(`rm /tmp/build-sources/${job.data.repository}/id.rsa`);
|
await asyncExecShell(
|
||||||
|
`test -f /tmp/build-sources/${job.data.repository}/id.rsa && rm /tmp/build-sources/${job.data.repository}/id.rsa`
|
||||||
|
);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
});
|
});
|
||||||
@@ -136,7 +138,9 @@ buildWorker.on('failed', async (job: Bullmq.Job, failedReason) => {
|
|||||||
} finally {
|
} finally {
|
||||||
const workdir = `/tmp/build-sources/${job.data.repository}/${job.data.build_id}`;
|
const workdir = `/tmp/build-sources/${job.data.repository}/${job.data.build_id}`;
|
||||||
await asyncExecShell(`rm -fr ${workdir}`);
|
await asyncExecShell(`rm -fr ${workdir}`);
|
||||||
await asyncExecShell(`rm /tmp/build-sources/${job.data.repository}/id.rsa`);
|
await asyncExecShell(
|
||||||
|
`test -f /tmp/build-sources/${job.data.repository}/id.rsa && rm /tmp/build-sources/${job.data.repository}/id.rsa`
|
||||||
|
);
|
||||||
}
|
}
|
||||||
saveBuildLog({ line: 'Failed build!', buildId: job.data.build_id, applicationId: job.data.id });
|
saveBuildLog({ line: 'Failed build!', buildId: job.data.build_id, applicationId: job.data.id });
|
||||||
saveBuildLog({
|
saveBuildLog({
|
||||||
|
|||||||
@@ -14,12 +14,12 @@ export const get: RequestHandler = async (event) => {
|
|||||||
where: { buildId, time: { gt: sequence } },
|
where: { buildId, time: { gt: sequence } },
|
||||||
orderBy: { time: 'asc' }
|
orderBy: { time: 'asc' }
|
||||||
});
|
});
|
||||||
const { status } = await db.prisma.build.findFirst({ where: { id: buildId } });
|
const data = await db.prisma.build.findFirst({ where: { id: buildId } });
|
||||||
|
|
||||||
return {
|
return {
|
||||||
body: {
|
body: {
|
||||||
logs,
|
logs,
|
||||||
status
|
status: data?.status || 'running'
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user