Co-authored-by: domfelipe <53182096+domfelipe@users.noreply.github.com>
This commit is contained in:
gpt-engineer-app[bot] 2026-04-23 18:10:40 +00:00
parent 3a64c930ea
commit b11e6da3a3

View file

@ -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,
);