cli
cli copied to clipboard
Add git metadata to deployments with `railway up`
Closes #178 (at least, it should)
This PR will add git metadata to deployments with railway up
when deploying a directory with a git repository.
Note: probably doesn't work on Windows (yet).
@aleksrutins at least for a very basic repo it gets the correct information on windows :)
Cool! If the repo has an origin
remote on GitHub, though, Repository name
is supposed to print out as user/repo
instead of just the directory name, so I'm not sure if that quite works correctly. The logic for that is the most likely to be non-Windows-compatible.
What would the API for this be? That's the only thing blocking me at this point.
Hey @aleksrutins,
Apologies for the late reply.
After thinking about this for a while I am not sure we want this in the CLI. The problem I see is if there are unstaged changes and we incorrectly attribute the deploy with the latest commit. This could show a failing build because of some local changes but when deployed from git from the actual commit the deploy would succeed. I guess we could only add the git information if there are no local changes? Thoughts?
Yeah, good point - I didn't think of that. I should make it only run if there are no local changes if this is going to get into the main code. I was kind of waiting until the public API docs were released at this point to continue working on this, since that's really the only thing (other than the local changes bit) left.