Docker Source Image Tag updates and deploy
robraux
PROOP

a year ago

I have a private docker registry configured and working for a service. The service is redeployed automatically in a CI/CD setup via:

railway redeploy --service=$RAILWAY_SERVICE_ID --yes

The configuration for source image is set with a tag like:

registry.gitlab.com/project/repo:qa

This is a functional deployment system, but requires tags be non-idempotent.

Question: Is there any method of updating the source image tag via railway cli (ideal) or API call?

I'd prefer to have the source tag for the deployment as:

registry.gitlab.com/project/repo:1.2.3

I've dug into these tools and forums but can find no proposals or best practices for using railway with a CI/CD that handles the image building itself.

Solved

1 Replies

brody
EMPLOYEE

a year ago

Hello,

This can't be done via the CLI, but it can be easily done via the API -

To update the source image -

mutation serviceInstanceUpdate($environmentId: String, $serviceId: String!, $input: ServiceInstanceUpdateInput!) {
  serviceInstanceUpdate(
    environmentId: $environmentId
    serviceId: $serviceId
    input: $input
  )
}
{
  "environmentId": "<environment_id>",
  "serviceId": "<service_id>",
  "input": {
    "source": {
      "image": "<image>"
    }
  }
}

To trigger a deployment from the newly updated source image -

mutation serviceInstanceDeploy($environmentId: String!, $serviceId: String!) {
  serviceInstanceRedeploy(
    environmentId: $environmentId
    serviceId: $serviceId
  )
}
{
  "environmentId": "<environment_id>",
  "serviceId": "<service_id>"
}

Status changed to Awaiting User Response Railway over 1 year ago


Railway
BOT

6 months ago

This thread has been marked as solved automatically due to a lack of recent activity. Please re-open this thread or create a new one if you require further assistance. Thank you!

Status changed to Solved Railway 6 months ago


Loading...