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?
Solution:Jump to solution
that variable would only be available at runtime since it would change every deployment, it's not available to reference
8 Replies
Project ID:
f3ddaf83-9602-481e-b3e6-4a5786029748
Solution
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?
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.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
Got it. Don't think that will work for our use case, but really appreciate the quick response.
nope a variable has nothing to do with a service depending on one another