Running Railway Up from CLI
Does anybody know if the railway up command waits until the service has been successfully built and deployed to railway before returning with a success status? I am using it in this CI workflow, and it seems that railway up returns much quicker than the actual build and deploy times being showed on railway.app
Here is a snippet of the CI
34 Replies
Project ID:
2999b3ba-4058-47fa-95a8-078486652ecc
2999b3ba-4058-47fa-95a8-078486652ecc
Also, this command is being run in a non-interactive setting (since it is being run in my ci)
the command does not wait, there is project webhooks though, the webhook is fired for every state for all services within your project
Okay thank you
I'm guessing that there is no way to make railway up wait
via built in command
or option
currently so such feature exists
gotcha
thanks
can you tell me more about your usecase though?
Sure
The desired logical use case is as follows:
So I have a backend that has a ci that's set to run on pull requests.
When a pull request is opened, the ci will check out the code, install railway cli and other dependencies, and will push this code to railway via railway up.
Once that service has been successfully deployed, I will run a series of e2e tests against the newly deployed service on railway and if those succeed, merge the PR.
The problem is that I can't wait for confirmation that the service has been deployed... So the e2e tests that will fire will miss the newly deployed service
makes sense
so to recap, you are looking for something like a
--wait
flag so that the cli will wait until your service has been successfully deployed and switched over, then once and only once that is detected exitexactly that would be ideal
hi hi @milo / salvage - bet you could implement this in 5 minutes
that challenge has been set, now we wait
lol if this personcan make a feature on the spot and deploy it to production for a use case, I will personally go on any forum/website and sing railways praises for a month 😆
he can
cold - give me a sec when im home (currently at football). I’ll lyk when I start working on it
I think cold is a British term
it is it just means alright or cool
I’ll be back in about 6 hours - got some pretty big in fitness stuff
Absolute beast
on the keyboard and on the field
it is all much appreciated
🙏
I'd like to note that once milo does this, the pr has to be merged and railway has to release a new version for it to then be installable via npm in ci
(usually takes 5 days or so)
Okay noted, I can live with that
I imagine if I regularly check railway/cli on gh there will be a release note that says this feature has been released
If not do you know where I can regularly check for the release?
Could you not also download the source code from the pr and run your own build?
so it wouldn’t be generally available, but you could still use the feature
I definitely could do that too... If milo could let me know the PR number that would be idea
ideal
could also check
this is where you see the releases https://github.com/railwayapp/cli/releases
but you can also do this on the repo to get notified when a new release is published
Either way, I look forward to it
@milo / salvage Hey there, how goes the wait feature?
taggin you here
oops, just got home. ill start working on it soon (just need to do some bugfixes on a project)
Sounds good
sorry to dig this up but may I know the status of this? currently we need exactly this, the ability to run e2e tests against the PR environment build
This will wait for the build to either deploy or fail and will exit with 0 or 1 accordingly
thanks @Brody , that is blasting fast, may I ask something more, as the CI/CD and github actions is not my expertise
currently I let the Railway trigger the deployment automatically with the PR environment, does that mean in order to use this feature, I have to turn it off and write the github actions and use
railway
CLI to trigger it by myself?that is correct
thank you very much, I will give it a try, have a nice day 🫂
you too!