SHA256
fix: build is excluded from git
Signed-off-by: sisungo <[email protected]>
This commit is contained in:
+1
-1
@@ -2,7 +2,7 @@
|
|||||||
node_modules/
|
node_modules/
|
||||||
|
|
||||||
# Build output
|
# Build output
|
||||||
build/
|
/build
|
||||||
.svelte-kit/
|
.svelte-kit/
|
||||||
|
|
||||||
# Rust build artifacts
|
# Rust build artifacts
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ export const POST: RequestHandler = async ({ request, cookies }) => {
|
|||||||
httpOnly: true,
|
httpOnly: true,
|
||||||
sameSite: 'lax',
|
sameSite: 'lax',
|
||||||
maxAge: 7 * 24 * 60 * 60,
|
maxAge: 7 * 24 * 60 * 60,
|
||||||
|
secure: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
return json({ ok: true });
|
return json({ ok: true });
|
||||||
|
|||||||
@@ -0,0 +1,29 @@
|
|||||||
|
import { json } from '@sveltejs/kit';
|
||||||
|
import { createBuild } from '$lib/server/db.js';
|
||||||
|
import type { RequestHandler } from './$types';
|
||||||
|
|
||||||
|
export const POST: RequestHandler = async ({ params, request, locals }) => {
|
||||||
|
if (!locals.user) {
|
||||||
|
return json({ error: 'Login required' }, { status: 401 });
|
||||||
|
}
|
||||||
|
|
||||||
|
const body = await request.json();
|
||||||
|
const arch = body.arch ?? '';
|
||||||
|
const target = body.target ?? `${arch || 'x86_64'}-semios-linux`;
|
||||||
|
const atombuild = body.atombuild ?? true;
|
||||||
|
const trigger = body.trigger ?? 'manual';
|
||||||
|
|
||||||
|
try {
|
||||||
|
const buildId = createBuild(params.name, target, atombuild, trigger);
|
||||||
|
return json({
|
||||||
|
status: 'queued',
|
||||||
|
build_id: buildId,
|
||||||
|
message: `Build of ${params.name} queued`
|
||||||
|
});
|
||||||
|
} catch (e) {
|
||||||
|
return json({
|
||||||
|
status: 'error',
|
||||||
|
message: (e as Error).message
|
||||||
|
}, { status: 500 });
|
||||||
|
}
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user