2 years ago
It doesn't seem like the RAILWAYDEPLOYMENTID variable is working and according to https://docs.railway.app/reference/variables#railway-provided-variables it should be available. I noticed that it's not a part of the auto completion for railway variables either. Is there no way to get a unique build number of some sorts (or even commit sha) as an environment variable?
11 Replies
2 years ago
that variable would only be available at runtime since it would change every deployment, it's not available to reference
I have a question related to this. Is there any way to enforce a "service dependency", such that when a service redeploys, it triggers a redeployment of another service?
2 years ago
theres nothing native to do that, but i am struggling to see how your question related to the original question
Hah, good question. I have a scenario where I'd like two services to be "coupled" when redeploying, and ideally, for one service to have access to the other service's RAILWAY_DEPLOYMENT_ID env var value. It doesn't have to be that variable though, just needs to be the same for both services when they redeploy.
I suspect this is possible via scripting with the public API, but am looking for a native approach.
I'm looking for something like a "service group", where one redeployment trigger will redeploy multiple services.
2 years ago
thats not possible with railway natively
2 years ago
but a variable that would be the same across all deployments and services in a given environment would be RAILWAY_ENVIRONMENT_ID
Got it. Don't think that will work for our use case, but really appreciate the quick response.
2 years ago
nope a variable has nothing to do with a service depending on one another