mirror of
https://github.com/domfelipe/mika-agent-assist.git
synced 2026-08-07 06:36:46 +00:00
Changes
Co-authored-by: domfelipe <53182096+domfelipe@users.noreply.github.com>
This commit is contained in:
parent
3a64c930ea
commit
b11e6da3a3
1 changed files with 7 additions and 2 deletions
|
|
@ -65,20 +65,25 @@ export async function configureRailwayService(opts: {
|
|||
environmentId: string;
|
||||
image: string;
|
||||
variables: Record<string, string>;
|
||||
startCommand?: string;
|
||||
}): Promise<void> {
|
||||
// O Railway expõe variáveis via variableUpsert (uma por vez) e fonte/imagem via serviceInstanceUpdate.
|
||||
// Setamos a imagem primeiro.
|
||||
// Setamos a imagem (e startCommand opcional) primeiro.
|
||||
const updateSource = `
|
||||
mutation ServiceInstanceUpdate($serviceId: String!, $environmentId: String!, $input: ServiceInstanceUpdateInput!) {
|
||||
serviceInstanceUpdate(serviceId: $serviceId, environmentId: $environmentId, input: $input)
|
||||
}
|
||||
`;
|
||||
const sourceInput: Record<string, unknown> = { source: { image: opts.image } };
|
||||
if (opts.startCommand) {
|
||||
sourceInput.startCommand = opts.startCommand;
|
||||
}
|
||||
const sourceRes = await railwayQuery(
|
||||
updateSource,
|
||||
{
|
||||
serviceId: opts.serviceId,
|
||||
environmentId: opts.environmentId,
|
||||
input: { source: { image: opts.image } },
|
||||
input: sourceInput,
|
||||
},
|
||||
opts.token,
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue