R
Railway12mo ago
ramnivas

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
Brody12mo ago
with the cli? no. with railways public api, yes
ramnivas
ramnivas12mo ago
Thanks for the pointer!
Brody
Brody12mo ago
if you need help with the api I can be of assistance later today
ramnivas
ramnivas12mo 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
Brody12mo 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
ramnivas12mo 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
Brody12mo ago
gotcha, but I think the api is a better fit for this kind of thing
Want results from more Discord servers?
Add your server