2 months ago
Hey Team,
We have a project with 4 services, and we're wanting to figure out how to migrate all settings related to the project and the ui to config as code so that we can automate changnes with claude instead of click ops.
I've used the cli to link a project locally, and git status reports as such, but I don't see a .railway or railway.toml
45 Replies
2 months ago
(no markdown available for this content)
2 months ago
IIRC there isn't a way to directly migrate all settings from the dashboard UI into toml/json.
2 months ago
The settings in the dashboard will not be updated with the settings defined in code. Configuration defined in code will always override values from the dashboard.
right so if I wanted to migrate to config as code, I'd have to:
- manually migrate the settings
- override the settings in the ui to match (because they won't be updated)
- tell devs not to touch the ui (because there's no way to lock it)
2 months ago
Basically, yes.
2 months ago
The UI will lock on certain settings once you have config files setup iirc
2 months ago
"Overriding" settings in the UI isn't necessary, but if you want them to match your json/toml configuration, then sure.
2 months ago
that sounds contradicting
2 months ago
That's what the docs say 🤷
2 months ago
cac takes priority
it also displays the cac value in the ui, and locks the ability to change it
2 months ago
Yes this is true. Been my experience
2 months ago
- if you open up a deployment on the dash, it shows the cac equivalent you can copy over
- see above
- yes to the "don't try to update in ui"
so point 3 is invalid because they'll be locked
point 2 is invalid for the above, but the docs are outdated
point 1 is still valid
2 months ago
sleepy read it wrong, edited
2 months ago
It'll be something like this.
Attachments
Thank you I've found the config as code in the ui
Something that's not really clear is, how they should be setup for multiple services in the same repo?
e.g. they all say to save as railway.toml
do I just rename them based on the service?
2 months ago
If it's in a monorepo, you can put the config file in each "service's" root directory.
2 months ago
Eg, if I have /frontend and /backend from the same repository hosted on Railway, I'd save each services' config files in /frontend/railway.json and /backend/railway.json.
2 months ago
Don't think that would be possible, if they're hosted from the same directory.
this is what was meant earlier by the config that I could copy out?
Attachments
2 months ago
Yes.
2 months ago
Each service has its own configuration.
Attachments
2 months ago
^
sorry what's not possible?
I have multiple workers defined from the same directory so that doesn't seem like the issue
2 months ago
IIRC Railway does not support having multiple config files in a single directory if multiple services are hosted in that directory.
2 months ago
These "config files" are generated from the service itself. It ignores other services.
2 months ago
No.
2 months ago
I believe that it is possible to make multiple files and do it like "content.railway.toml", might not be detected properly but nothing should stop you from setting the path manually
2 months ago
How would you set the path?
2 months ago
in service settings of course
Attachments
2 months ago
free form input with autocomplete
2 months ago
Nevermind I'm blind 💀
2 months ago
hi blind im astrid
2 months ago
@evan turns out you can do something like worker1.railway.toml and worker2.railway.toml as long as you specify the path to the config file as shown in Astrid’s image.
-# Sorry 😭
2 months ago
-# Sorry 😭