Possible to add variables without using the Dashboard UI?

I have a GraphQL server connected to a Postgres database. Currently, I add variable references to DATABASE_PRIVATE_URL through the dashboard. Is it possible to avoid using the dashboard? I looked through the railway cli and railway.toml docs but couldn't find anything that would allow me to do so.
7 Replies
Brody
Brody7mo ago
with the cli? no. with railways public api, yes
ramnivas
ramnivas7mo ago
Thanks for the pointer!
Brody
Brody7mo ago
if you need help with the api I can be of assistance later today
ramnivas
ramnivas7mo ago
Thank you so much for responding quickly and precisely to queries. I looked through the API documentation, and it seems reasonable. For context: We recently added Railway integration to our product (https://exograph.dev/docs/deployment/railway), and I was trying to see if there is a way to avoid dashboard UI steps. Ideally, railway.toml would be comprehensive enough to cover specifying all project constituents and variables for each (then it would be a simple git push or railway up).
Brody
Brody7mo ago
even if it did work like that, it would involve putting your variables in plaintext and then pushing them to your repo, far from anything you'd want to do
ramnivas
ramnivas7mo ago
Ideally, it would allow variable referencing, something along the following lines:
...
- services:
postgres: <url to Postgres repo>
- env:
DATABASE_URL:
kind: reference
value: "postgres.DATABASE_URL"
...
...
- services:
postgres: <url to Postgres repo>
- env:
DATABASE_URL:
kind: reference
value: "postgres.DATABASE_URL"
...
Brody
Brody7mo ago
gotcha, but I think the api is a better fit for this kind of thing