From eacec74701e0f09492e131946308483a17b6012e Mon Sep 17 00:00:00 2001 From: Mark Henderson Date: Tue, 21 Apr 2026 12:07:12 -0700 Subject: [PATCH] fix(coolify): use /deploy?uuid=... endpoint (Coolify v4) Made-with: Cursor --- lib/coolify.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/coolify.ts b/lib/coolify.ts index 0e48d4c..35d3af7 100644 --- a/lib/coolify.ts +++ b/lib/coolify.ts @@ -429,8 +429,18 @@ export async function listApplications(): Promise { return coolifyFetch('/applications'); } -export async function deployApplication(uuid: string): Promise<{ deployment_uuid: string }> { - return coolifyFetch(`/applications/${uuid}/deploy`, { method: 'POST' }); +export async function deployApplication(uuid: string, opts: { force?: boolean } = {}): Promise<{ deployment_uuid: string }> { + // Coolify v4 exposes deploy as POST /deploy?uuid=...&force=... + // The older /applications/{uuid}/deploy path is a 404 on current + // Coolify releases. + const q = new URLSearchParams({ uuid }); + if (opts.force) q.set('force', 'true'); + const res = await coolifyFetch(`/deploy?${q.toString()}`, { method: 'POST' }); + // Response shape: { deployments: [{ deployment_uuid, ... }] } or direct object. + const first = Array.isArray(res?.deployments) ? res.deployments[0] : res; + return { + deployment_uuid: first?.deployment_uuid ?? first?.uuid ?? '', + }; } export async function getApplication(uuid: string): Promise {