22 days ago
hi,
i set mysql DB with only private networking as i don't want to expose db to public.
but i want to run liquibase to do db changes and i can do that manually by logging into db server using ssh, but how can i do it non-interactively? does railway ssh supports login using token?
thanks.
3 Replies
22 days ago
The railway ssh command supports running a single command non-interactively via railway ssh -- , and you can authenticate it in CI/CD by setting the RAILWAY_TOKEN environment variable (a project token). That said, for running Liquibase migrations, the recommended approach is to use a pre-deploy command in your service settings, which executes within the private network with access to all your service's environment variables, and runs automatically before each deployment. Note that railway run executes commands locally, so it would not have access to the private network.
Status changed to Awaiting User Response Railway • 22 days ago
22 days ago
thanks, if I use liquibase command as pre-deploy then does it mean liquibase should be installed ahead on the docker image? or railway able to run the liquibase command on db without my image having liquibase ?
Status changed to Awaiting Railway Response Railway • 22 days ago
22 days ago
This thread has been marked as public for community involvement, as it does not contain any sensitive or personal information. Any further activity in this thread will be visible to everyone.
Status changed to Open Railway • 22 days ago
18 days ago
never mind, I need to have seperate liquibase migration service which will run against the db and cannot use pre-delpoy command as db won't be ready with that option.
Status changed to Solved Railway • 18 days ago