fix: Minor fixes
This commit is contained in:
@@ -105,7 +105,6 @@ export async function forceSSLOffApplication({ domain }) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
export async function forceSSLOnApplication({ domain }) {
|
export async function forceSSLOnApplication({ domain }) {
|
||||||
if (!dev) {
|
|
||||||
const haproxy = await haproxyInstance();
|
const haproxy = await haproxyInstance();
|
||||||
await checkHAProxy(haproxy);
|
await checkHAProxy(haproxy);
|
||||||
let transactionId;
|
let transactionId;
|
||||||
@@ -142,7 +141,7 @@ export async function forceSSLOnApplication({ domain }) {
|
|||||||
type: 'redirect',
|
type: 'redirect',
|
||||||
redir_type: 'scheme',
|
redir_type: 'scheme',
|
||||||
redir_value: 'https',
|
redir_value: 'https',
|
||||||
redir_code: 301
|
redir_code: dev ? 302 : 301
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.json();
|
.json();
|
||||||
@@ -152,9 +151,6 @@ export async function forceSSLOnApplication({ domain }) {
|
|||||||
} finally {
|
} finally {
|
||||||
if (transactionId) await completeTransaction(transactionId);
|
if (transactionId) await completeTransaction(transactionId);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
console.log(`[DEBUG] Adding ssl for ${domain}`);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function deleteProxy({ id }) {
|
export async function deleteProxy({ id }) {
|
||||||
|
@@ -261,6 +261,7 @@ export default async function (job) {
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
saveBuildLog({ line: error.stdout || error, buildId, applicationId });
|
saveBuildLog({ line: error.stdout || error, buildId, applicationId });
|
||||||
sentry.captureException(error);
|
sentry.captureException(error);
|
||||||
|
throw new Error(error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -127,7 +127,6 @@ buildWorker.on('completed', async (job: Bullmq.Job) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
buildWorker.on('failed', async (job: Bullmq.Job, failedReason) => {
|
buildWorker.on('failed', async (job: Bullmq.Job, failedReason) => {
|
||||||
console.log(failedReason);
|
|
||||||
try {
|
try {
|
||||||
await prisma.build.update({ where: { id: job.data.build_id }, data: { status: 'failed' } });
|
await prisma.build.update({ where: { id: job.data.build_id }, data: { status: 'failed' } });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@@ -136,7 +135,11 @@ buildWorker.on('failed', async (job: Bullmq.Job, failedReason) => {
|
|||||||
const workdir = `/tmp/build-sources/${job.data.repository}`;
|
const workdir = `/tmp/build-sources/${job.data.repository}`;
|
||||||
await asyncExecShell(`rm -fr ${workdir}`);
|
await asyncExecShell(`rm -fr ${workdir}`);
|
||||||
}
|
}
|
||||||
saveBuildLog({ line: 'Failed build!', buildId: job.data.build_id, applicationId: job.data.id });
|
saveBuildLog({
|
||||||
|
line: 'Failed to deploy!',
|
||||||
|
buildId: job.data.build_id,
|
||||||
|
applicationId: job.data.id
|
||||||
|
});
|
||||||
saveBuildLog({
|
saveBuildLog({
|
||||||
line: `Reason: ${failedReason.toString()}`,
|
line: `Reason: ${failedReason.toString()}`,
|
||||||
buildId: job.data.build_id,
|
buildId: job.data.build_id,
|
||||||
|
@@ -82,7 +82,7 @@
|
|||||||
}
|
}
|
||||||
async function loadBuild(build) {
|
async function loadBuild(build) {
|
||||||
buildId = build;
|
buildId = build;
|
||||||
goto(`/applications/${id}/logs/build?buildId=${buildId}`);
|
await goto(`/applications/${id}/logs/build?buildId=${buildId}`);
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -94,13 +94,15 @@
|
|||||||
<div class="block flex-row justify-start space-x-2 px-5 pt-6 sm:px-10 md:flex">
|
<div class="block flex-row justify-start space-x-2 px-5 pt-6 sm:px-10 md:flex">
|
||||||
<div class="mb-4 min-w-[16rem] space-y-2 md:mb-0 ">
|
<div class="mb-4 min-w-[16rem] space-y-2 md:mb-0 ">
|
||||||
<div class="top-4 md:sticky">
|
<div class="top-4 md:sticky">
|
||||||
{#each builds as build (build.id)}
|
{#each builds as build, index (build.id)}
|
||||||
<div
|
<div
|
||||||
data-tooltip={new Intl.DateTimeFormat('default', dateOptions).format(
|
data-tooltip={new Intl.DateTimeFormat('default', dateOptions).format(
|
||||||
new Date(build.createdAt)
|
new Date(build.createdAt)
|
||||||
) + `\n${build.status}`}
|
) + `\n${build.status}`}
|
||||||
on:click={() => loadBuild(build.id)}
|
on:click={() => loadBuild(build.id)}
|
||||||
class="tooltip-top flex cursor-pointer items-center justify-center rounded-r border-l-2 border-transparent py-4 no-underline transition-all duration-100 hover:bg-coolgray-400 hover:shadow-xl "
|
class:rounded-tr={index === 0}
|
||||||
|
class:rounded-br={index === builds.length - 1}
|
||||||
|
class="tooltip-top flex cursor-pointer items-center justify-center border-l-2 border-transparent py-4 no-underline transition-all duration-100 hover:bg-coolgray-400 hover:shadow-xl "
|
||||||
class:bg-coolgray-400={buildId === build.id}
|
class:bg-coolgray-400={buildId === build.id}
|
||||||
class:border-red-500={build.status === 'failed'}
|
class:border-red-500={build.status === 'failed'}
|
||||||
class:border-green-500={build.status === 'success'}
|
class:border-green-500={build.status === 'success'}
|
||||||
|
@@ -12,7 +12,7 @@ import {
|
|||||||
} from '$lib/haproxy';
|
} from '$lib/haproxy';
|
||||||
import { letsEncrypt } from '$lib/letsencrypt';
|
import { letsEncrypt } from '$lib/letsencrypt';
|
||||||
import type { RequestHandler } from '@sveltejs/kit';
|
import type { RequestHandler } from '@sveltejs/kit';
|
||||||
import dns from 'dns/promises';
|
import { promises as dns } from 'dns';
|
||||||
|
|
||||||
export const get: RequestHandler = async (event) => {
|
export const get: RequestHandler = async (event) => {
|
||||||
const { status, body } = await getUserDetails(event);
|
const { status, body } = await getUserDetails(event);
|
||||||
|
Reference in New Issue
Block a user