RAILWAY_DEPLOYMENT_ID isn't available?

It doesn't seem like the RAILWAY_DEPLOYMENT_ID 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?
Railway Docs
Variables | Railway Docs
Documentation for Railway
Solution:
that variable would only be available at runtime since it would change every deployment, it's not available to reference
Jump to solution
8 Replies
Percy
Percy7mo ago
Project ID: f3ddaf83-9602-481e-b3e6-4a5786029748
Solution
Brody
Brody7mo ago
that variable would only be available at runtime since it would change every deployment, it's not available to reference
typedarray
typedarray5mo ago
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?
Brody
Brody5mo ago
theres nothing native to do that, but i am struggling to see how your question related to the original question
typedarray
typedarray5mo ago
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.
Brody
Brody5mo ago
thats not possible with railway natively but a variable that would be the same across all deployments and services in a given environment would be RAILWAY_ENVIRONMENT_ID
typedarray
typedarray5mo ago
Got it. Don't think that will work for our use case, but really appreciate the quick response.
Brody
Brody5mo ago
nope a variable has nothing to do with a service depending on one another
Want results from more Discord servers?
Add your server