Is there a way to connect to server via cli and then run some scripts like heroku has heroku run
We want to manually run an npm script in our code on live deployment is there a way to do that in CLI. On heroku we had option to use heroku run.
10 Replies
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Might be possible depending on the script using
railway run
with the CLI.its npm script that we want to run. We have a script that indexes our data to algolia which we sometimes manually run via cli.
could you please link to railway run docs?
https://docs.railway.app/reference/cli-api#run
Just make sure you're in the right environment/project etc.
So I have to first connect project locally and then give flag for environment right?
Yep,
railway link PROJECT_ID
and then I think you can simply do railway environment
to switch environments.
That way, you don't need to attach the flag.
railway status
to check where you're at.Ok, let me try a test.
How to select which repo to run against?
What do you mean? I am assuming you have the repo cloned locally and are running all the commands in that directory.
noted
I have cloned.
Awesome, CLI app is really great, it asked me about the repo I want to run as services to select which environment I want to pick. In short less friction.
I am really enjoying it.
Thanks for the help!
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View