mirror of
https://github.com/domfelipe/mika-agent-assist.git
synced 2026-08-07 08:16:41 +00:00
Corrigiu deploy e busca do runtime
X-Lovable-Edit-ID: edt-bb3c0f4c-454c-44c4-92d8-918a910e2212 Co-authored-by: domfelipe <53182096+domfelipe@users.noreply.github.com>
This commit is contained in:
commit
9c91c6d509
2 changed files with 19 additions and 2 deletions
|
|
@ -347,8 +347,12 @@ export async function listRailwayServiceDomains(opts: {
|
|||
environmentId: string;
|
||||
projectId?: string | null;
|
||||
}): Promise<{ serviceDomains: RailwayServiceDomainInfo[]; customDomains: RailwayServiceDomainInfo[] }> {
|
||||
if (!opts.projectId) {
|
||||
throw new Error("projectId is required to list Railway service domains");
|
||||
}
|
||||
|
||||
const query = `
|
||||
query Domains($environmentId: String!, $serviceId: String!, $projectId: String) {
|
||||
query Domains($environmentId: String!, $serviceId: String!, $projectId: String!) {
|
||||
domains(environmentId: $environmentId, serviceId: $serviceId, projectId: $projectId) {
|
||||
serviceDomains {
|
||||
id
|
||||
|
|
@ -375,7 +379,7 @@ export async function listRailwayServiceDomains(opts: {
|
|||
{
|
||||
environmentId: opts.environmentId,
|
||||
serviceId: opts.serviceId,
|
||||
projectId: opts.projectId ?? null,
|
||||
projectId: opts.projectId,
|
||||
},
|
||||
opts.token,
|
||||
);
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
import { createClient } from "https://esm.sh/@supabase/supabase-js@2.45.4";
|
||||
import { corsHeaders } from "../_shared/cors.ts";
|
||||
import {
|
||||
HERMES_START_COMMAND,
|
||||
createRailwayService,
|
||||
configureRailwayService,
|
||||
deployRailwayService,
|
||||
|
|
@ -280,6 +281,7 @@ Deno.serve(async (req) => {
|
|||
projectId: pool.railway_project_id,
|
||||
image: "ghcr.io/domfelipe/hermes-agent-custom:latest",
|
||||
variables: envVars,
|
||||
startCommand: HERMES_START_COMMAND,
|
||||
});
|
||||
console.log(`[provision-agent] serviço configurado com ${Object.keys(envVars).length} env vars`);
|
||||
|
||||
|
|
@ -500,6 +502,17 @@ async function handleUpdateExistingService(
|
|||
});
|
||||
console.log(`[provision-agent:update] variáveis atualizadas (${Object.keys(variables).length})`);
|
||||
|
||||
await configureRailwayService({
|
||||
token: RAILWAY_API_TOKEN!,
|
||||
serviceId: railwayServiceId,
|
||||
environmentId,
|
||||
projectId,
|
||||
image: "ghcr.io/domfelipe/hermes-agent-custom:latest",
|
||||
variables: {},
|
||||
startCommand: HERMES_START_COMMAND,
|
||||
});
|
||||
console.log(`[provision-agent:update] imagem/start command reconciliados`);
|
||||
|
||||
await deployRailwayService({
|
||||
token: RAILWAY_API_TOKEN!,
|
||||
serviceId: railwayServiceId,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue